
shell脚本调用docker里面的python脚本,如何返回一个值(状态码)给shell脚本?
1个回答
展开全部
# test.py
print "hello, world"
# test.sh
result=`python test.py`
echo $result
# 执行
bash test.sh
# 结果
hello, world
print "hello, world"
# test.sh
result=`python test.py`
echo $result
# 执行
bash test.sh
# 结果
hello, world
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询