24 lines
490 B
Bash
24 lines
490 B
Bash
|
#!/bin/sh
|
|||
|
|
|||
|
# 定义程序命令和参数
|
|||
|
PROGRAM="./exp.py"
|
|||
|
|
|||
|
# 无限循环直到程序返回值为0
|
|||
|
while true; do
|
|||
|
# 运行程序并捕获返回值
|
|||
|
$PROGRAM REMOTE DEBUG
|
|||
|
RETURN_VALUE=$?
|
|||
|
|
|||
|
# 检查返回值
|
|||
|
if [ $RETURN_VALUE -eq 0 ]; then
|
|||
|
echo "程序成功运行,返回值为0"
|
|||
|
break
|
|||
|
else
|
|||
|
echo "程序运行失败,返回值为$RETURN_VALUE"
|
|||
|
# 根据需要处理错误,例如重试或记录日志
|
|||
|
fi
|
|||
|
done
|
|||
|
|
|||
|
# 循环结束后继续执行其他命令
|
|||
|
# ...
|