【发布时间】:2017-06-08 07:13:46
【问题描述】:
我有一个脚本,它将检查 if 语句中的多个条件并在其为真时运行所需的命令。
if [ ! -f /tmp/a ] && [ ! -f /tmp/b ]; then
touch /tmp/c else
echo "file exists" fi
我现在需要知道多个条件中哪一个是正确的。 例如:曾经存在的 /tmp/a 或 /tmp/b。有没有办法在我的 else 条件下得到它?
【问题讨论】:
标签: bash shell if-statement multiple-conditions