help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Validating files and directories


From: irenezerafa
Subject: Validating files and directories
Date: Sat, 13 Nov 2021 00:22:18 +0000

I am using the following commands to validate a file or directory.

if [[ ! -f "$fl" && ! -d "$fl" ]]; then
printf '%s\n' "$fl: File or Directory does not exist"
fi

But have noticed that I can use -e to see if there's something by that name, 
instead of separately testing -f and -d.
Yet I am getting confused between using -a and -e.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]