shell脚本数组报错Syntax error: "(" unexpected

.sh 文件中执行错误

发现 ubuntu 模式使用的是 dash 模式,如果不想报错使用 bash 模式

可使用命令 bash xxx.sh   或者  将脚本第一行改为 #!/bin/bash,执行./example.sh也可以

原文地址:https://www.cnblogs.com/peng-lan/p/10813783.html