Bash: If statement
31 May 2023 (Updated 31 May 2023)
directory="/path/to/directory"
if [ -d "$directory" ]; then
echo "The directory exists."
else
echo "The directory does not exist."
fi
Tagged:
Bash
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment