bash file exists

 cat conditf
#!/bin/bash
FILE=$1

if [_-f $FILE_];
then
   echo "File $FILE exists."
else
   echo "File $FILE does not exist."
fi

./conditf sc
File sc does not exist.

./conditf sc3
File sc3 exists.


#-f file - True if file exists and is a regular file.

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all