一般来说如果在echo里直接写上\n,他不会被转义,必须加上-e参数

echo "hello\n morning"
# 输出为 hello\n morning

echo -e "hello\n morning"
# 输出为 
#hello
# morning

貌似如果带-e参数,!等符号也变成shell的运算符,所以-e还是不能滥用

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
相关资源
相似解决方案