I have a bash script that depends on a group of existing folders, but I don't need to create folders manually every time I use the script on a new computer.
Now I have the following for detecting and creating directories (taken from here ):
for i in {7..0} do if [ ! -d "backup.${i}" ]; then mkdir backup.${i} fi done
This detects and backs up folders using "backup.0" through "backup.7", but this should be a more elegant way to do this.
source share