Loading

不同系统执行相同shell脚本,出现Syntax error: "(" unexpected错误解决

  例如shell脚本在centos系统中能正常执行,而在ubuntu系统中执行会出现类似Syntax error: "(" unexpected的错误,一般这种是因为sh与bash有些地方不兼容,解决方式:

  1.执行bash xx.sh

  2.执行chmod +x xx.sh对shell脚本赋予执行权限,之后执行./xx.sh

posted @ 2019-01-09 18:28  街头卖艺的肖邦  阅读(4195)  评论(0编辑  收藏  举报