Zi 字媒體
2017-07-25T20:27:27+00:00
Shell 判斷檔案是否存在
Shell 判斷檔案是否存在功能,範例如下:
Shell IsFile.sh
#!/bin/bash
#Filename: IsFile.sh
filepath=”/home/jash/IsFile.sh”
if [ -e $filepath ];then
echo $filepath exists
else
echo $filepath does not exist
fi
參考出處:Linux Shell 腳本攻略 P 32
寫了
5860316篇文章,獲得
23313次喜歡