1.双引号
$,`,\,保留特殊意义
注意echo不加参数默认不支持\n这种转义字符
printf支持
\n
[root@Centos5 test]#
[root@Centos5 test]#
注意在双引号中引用特殊字符echo "\特殊字符"
#双引号中已知特殊字符$`\"四个
echo "\""
"
echo "\$"
$
2.单引号
引用的字符解释为字符表面意思
注意echo -e时不论是单引号还是双引号中都会解释\n等转义字符
转义字符表
\\ \a \b \c \f \n \t \r \v
# 不要和\$混淆
[root@Centos5 test]#
[root@Centos5 test]# echo -e '\"'
\
[root@Centos5 test]# echo -e '\\'
\
[root@Centos5 test]# echo \
>
ls: *.111: No such file or directory
IFS
CR
=
$
>
#这些字符不被引用时需要转义
echo \=
=
有些输出我也不知道那就试试了反正就几次结果就出来了
















