【发布时间】:2017-04-08 03:25:31
【问题描述】:
我都
我想知道如何从 2nd 获取返回值。 shell 执行并将其保存在第一个脚本中的变量中。
类似的东西
第一个脚本:
Result=$(. /dir/to/mysecond/shell/second_shell.sh "Blue")
echo ${Result}
第二个脚本:
if [ $1 == "Blue" ]; then
return_value="The color is blue"
else
return_value="The color is not blue"
fi
return ${return_value}
结果变量在第一个脚本中是空的,知道吗?
【问题讨论】:
标签: shell unix return return-value