Answers for "shell check if file exsists"

21

check if file exists bash

FILE=/etc/resolv.conf
if [ -f "$FILE" ]; then
    echo "$FILE exists."
else 
    echo "$FILE does not exist."
fi
Posted by: Guest on October-23-2020
0

test if file is executable bash

if [ -x file ]; then
  ./file
else
  echo "File is not executable"
fi
Posted by: Guest on November-02-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language