You are correct, the author is a beginner for three separate reasons
1) mkdir -p succeeds silently if the directory already exists, so the test is pointless
2) In any case, good practice is to do what you wanna do and take remedial action if it fails, not to see whether you can do it and then if you can. That is for the terminally underconfident:)
3) Even if that weren't the case, what's wrong with "test -d/tmp/a/b/c"
For good Unix practice you are better off reading a random page of Raymond's collected "Art of Unix Programming", on the net at http://catb.org/~esr/writings/taoup/
You are correct, the author is a beginner for three separate reasons
:)
/tmp/a/b/c"
1) mkdir -p succeeds silently if the directory already exists, so the test is pointless
2) In any case, good practice is to do what you wanna do and take remedial action if it fails, not to see whether you can do it and then if you can. That is for the terminally underconfident
3) Even if that weren't the case, what's wrong with "test -d
For good Unix practice you are better off reading a random page of Raymond's collected "Art of Unix Programming", on the net at http://catb.org/~esr/writings/taoup/