我来这里因为我有一个我不明白的错误。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,但我不知道用什么来代替。谢谢 –