#!/bin/bash
rm -f file1
if [ -f file1 ] || echo "hello" || echo "there"
then echo "in if"
else
echo "in else"
fi
exit 0shell Learning [or 的用法]
最新推荐文章于 2025-12-05 03:26:29 发布
本文介绍了一个使用bash脚本执行文件删除操作并根据条件执行不同命令的实例。通过示例代码演示了如何在删除文件后,依据文件是否存在执行不同的输出信息。
556

被折叠的 条评论
为什么被折叠?



