我來這裏因爲我有一個我不明白的錯誤。Bash錯誤CSS文件
我有一個名爲 「test.css」 包含文件:
body {
/* Petit test de commentaire */
background: url("/dev/null");
border : 2px white solid ;
}
/**
* Commentaire
* sur ********
* plusieurs //
* lignes !!!
*/
body:hover {
color: red!important;
}
當我做
cat test.css
,無可厚非。
但如果我這樣做
echo `cat test.css`
或
echo $(cat test.css)
我:
body { /bin /boot /cdrom /dev /etc /home /initrd.img /initrd.img.old /lib /lib32 /lib64 /lost+found /media /mnt /opt /proc /root /run /sbin /snap /srv /sys /tmp /usr /var /vmlinuz /vmlinuz.old Petit test de commentaire new/ testComment/ testdir/ background: url("/dev/null"); border : 2px white solid ; } /bin /boot /cdrom /dev /etc /home /initrd.img /initrd.img.old /lib /lib32 /lib64 /lost+found /media /mnt /opt /proc /root /run /sbin /snap /srv /sys /tmp /usr /var /vmlinuz /vmlinuz.old block.txt log.txt mini.sh new newFile.css test2.html test3.html test4.html testComment testdir test.html tr Commentaire block.txt log.txt mini.sh new newFile.css test2.html test3.html test4.html testComment testdir test.html tr sur block.txt log.txt mini.sh new newFile.css test2.html test3.html test4.html testComment testdir test.html tr block.txt log.txt mini.sh new newFile.css test2.html test3.html test4.html testComment testdir test.html tr plusieurs // block.txt log.txt mini.sh new newFile.css test2.html test3.html test4.html testComment testdir test.html tr lignes !!! new/ testComment/ testdir/ body:hover { color: red!important; }
我的目標是使用命令tr
但是,我使用cat test.css | tr '\n' ' '
所以,如果你能幫我解決這個問題,謝謝!
你不需要這裏'cat',google''Useless-Use-Of-Cat',你只需要'echo'$(
Inian
\ *'和其他特殊字符正在被你正在運行的shell解釋,因此你爲什麼得到/ * – FreudianSlip
目錄的列表啊,是的。我已經看到Useless-Use-Cat,但我不知道用什麼來代替。謝謝 –