所以假设我有一个名为test.sh的shellscript/bash脚本
有:
#!/bin/bash
TESTVARIABLE=hellohelloheloo
./test2.sh
Run Code Online (Sandbox Code Playgroud)
我的test2.sh看起来像这样
#!/bin/bash
echo ${TESTVARIABLE}
Run Code Online (Sandbox Code Playgroud)
这不起作用.我不想将所有变量作为参数传递,因为imho这是过度的.有不同的方式吗?