Answers for "bash test file does not exist"

12

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

sh or bash validate if file no exist

FILE=/etc/docker
if [ ! -f "$FILE" ]; then
    echo "$FILE does not exist."
fi
Posted by: Guest on April-22-2021

Code answers related to "bash test file does not exist"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language