Shell script to test whether a directory exists and if not create it?
- by George Edison
I am trying to create a script to detect whether a directory exists, and if it does, to create it.
How can I do that?
I did some digging and found a clue:
test -d directory
...will return true or false depending on whether the directory exists or not.
But how do I tie this together with mkdir?