如果你在shell下面很正常的定义的数组

A=(a b c def)

可是在脚本里面执行,却收获了一个错误

Syntax error: "(" unexpected

那么是因为shell的版本不同造成的

我们习惯上默认为linux下面都用bash,但是debian系的,如ubuntu基于执行速度的考虑用了dash

所以,我们习惯的

sh a.sh

最终会调用dash所以出错

关于dash与bash的区别参考

http://www.igigo.net/archives/169

相关文章:

  • 2022-12-23
  • 2021-07-21
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2021-08-16
猜你喜欢
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
  • 2021-12-06
相关资源
相似解决方案