shell脚本中的if条件是什么-f?

时间:2016-04-07 07:37:06

标签: shell

tmpFilename = “buildDefTemp.txt”

if [ -f $tmpFilename ]; then
    rm -f $tmpFilename
fi
if [ -f $buildDefinitionFile ]; then
    rm -f $buildDefinitionFile
fi

1 个答案:

答案 0 :(得分:1)

http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html

[ -f FILE ] True if FILE exists and is a regular file.