Ubuntu中的shell版本是bash,直接使用命令sh xx.sh运行时会出现错误,解决办法:

  (一)使用命令bash xx.sh来进行运行

   (二)使用命令sudo dpkg-reconfigure dash 把bash更改为dash,这样就可以使用sh xx.sh命令来运行shell脚本了