unit testing - Bash: How to test for failure of mkdir command? -


i'm writing bash script , want robust error checking in it.

the exit status code mv make fail easy simulate failure. have move file doesn't exist, , fails.

however mkdir want simulate failing. mkdir fail number of reasons, problems disk, or lack of permissions, not sure how simulate failure.

mkdir fail if directory exists (unless using -p), , return error code of 1 (on system), create directory first test on own system. (although assume standard across shells.)

alternatively, make parent directory read-only.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -