我是靠谱客的博主 个性翅膀,这篇文章主要介绍linux ubuntu bash shell报错 xxx.sh: Syntax error: “(“ unexpected,现在分享给大家,希望可以做个参考。
原因可能是你使用了sh而不是bash去运行你的脚本,sh没有数组定义,而bash有
bash脚本的开头应该为:
#!/bin/bash
运行命令为:
$ sudo bash xxx.sh
sh脚本开头没有限制。运行命令为:
$ sudo sh xxx.sh
https://unix.stackexchange.com/questions/253892/syntax-error-unexpected-when-creating-an-array
最后
以上就是个性翅膀最近收集整理的关于linux ubuntu bash shell报错 xxx.sh: Syntax error: “(“ unexpected的全部内容,更多相关linux内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复