← Back to context

Comment by sandreas

4 years ago

Shell scripting: https://pilabor.com/blog/2021/04/shell-scripting-cheatsheet/

Markdown: https://pilabor.com/blog/2021/04/markdown-cheatsheet/

> mkdir if not exists

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

No need to check when using "-p".

  • 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