【发布时间】:2014-11-09 21:57:19
【问题描述】:
我的 shell 脚本中的行是
OUTPUTMESSAGE="****Warning error $MYERRORNUM ****"
echo $OUTPUTMESSAGE
星号扩展为文件名,因此看起来像
file1 file2 file 3 file4 Warning error 404 file1 file2 file 3 file4
如何防止echo 中的* 扩展?
【问题讨论】:
-
对bash有效,试试看:compileonline.com/execute_bash_online.php
-
bash 转义字符是
\反斜杠,而不是/