I want to check for the existence of multiple directories, say,
dir3, in the working directory.
I have the following
if [ -d "$PWD/dir1" ] && [ -d "$PWD/dir2" ] && [ -d "$PWD/dir3" ]; then echo True else echo False fi
But I suspect there is a more elegant way of doing this. Do not assume that there is a pattern in the names of the directories.
The goal is to check for the existence of a few directories and for the nonexistence of others.
I'm using Bash, but portable code is preferred.