我有一个脚本,它是一系列其他脚本中发送电子邮件的脚本之一。
在脚本开始时,我想检查文件是否存在,仅当存在时才继续执行,否则就退出。
这是我的脚本开头:
if [ ! -f /scripts/alert ];
then
echo "File not found!" && exit 0
else
continue
fi
然而我一直收到一个信息,内容如下:
line 10: continue: only meaningful in a `for', `while', or `until' loop
有什么提示吗?