Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by johnchristopher

4 years ago

> mkdir if not exists

  [ -d "${DIR}" ] || (mkdir -p "${DIR}")

No need to check when using "-p".

1 comment

johnchristopher

Reply

sandreas  4 years ago

You are absolutely right :-) I think, that this is a relict, since I personally use an alias for mkdir:

  alias mkdir='mkdir -p'

Thank you

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities