Linux 技术手札

Shell Script 检查档案及目录是否存在

在 Shell Script 检查档案及目录是否存跟 Perl 很相似, 都是透过 -e 及 -d 在 if 里面判断, 写法如下:

检查目录是否存在

检查档案是否存在

Exit mobile version