我正在设置一个脚本,该脚本使用另一个脚本中的变量。脚本 1 有变量脚本 2 引用脚本 1 并输出意外错误。通过 GCP 安装全新的 Debian 9。1.sh1="test"2="test2"3="test3"2.shsource 1.shecho $1echo $2echo $3运行 2.sh,我预计:testtest2test3但我收到了:1.sh: line 2: 1=test: command not found1.sh: line 3: 2=test2: command not found1.sh: line 4: 3=test3: command not found#empty line##empty line##empty line#这个链接告诉我这就是 bash 变量的声明方式。我该如何解决这个问题?
1 回答
- 1 回答
- 0 关注
- 199 浏览
添加回答
举报
0/150
提交
取消