I would like a cleaner way to nest this command;if [ ! -d $BACKUPDIR ]; then  mkdir -p $BACKUPDIR  mkdir -p $BACKUPDIR/directories  mkdir -p $BACKUPDIR/databases  mkdir -p $BACKUPDIR/logselse  :fi
create a nest of directories in bash
bash;directory structure
With brace expansion, you could do justmkdir -p $BACKUPDIR/{directories,databases,logs}If you want to make sure the subdirectories exist, too, you can just run mkdir without the test. With -p it shouldn't complain about existing directories, and there will be no chance of the main directory $BACKUPDIR existing, but the subdirectories missing.(Of course, if BACKUPDIR is empty, this will (try to) create the subdirectories in the file system root directory. But I'll assume you've set BACKUPDIR to some value earlier in the script.)