2016年1月14日星期四

shell 输出换行

str="a\nb\nc\n"

输出为
a
b
c
Mac 下 直接
echo ${str}
但是 Linux 下需要加 -e参数:
echo -e ${str}

没有评论 :

发表评论