Shell中echo变量时,变量中的多个空格只打印了一个,如下
$ tmp = " a b c "
$ echo $tmp
结果
a b c
解决办法是给变量加上双引号”,如下
$ tmp = " a b c "
$ echo " $tmp "
结果
a b c
转载地址:https://www.cnblogs.com/kadinzhu/archive/2011/05/20/2051694.html