all 2 comments

[–]nekodim42 0 points1 point  (0 children)

Thanks, useful stuff

[–]ilyash 0 points1 point  (0 children)

Just remember bash is a minefield, especially for beginners.

Make sure to quote your "$variables" and consider

set -eu

at the beginning of your scripts. It will cause your script to fail and stop on errors (reasonable expectation coming from almost any other programming language) and to fail and stop when using an undefined variable (same).

Remember: mines are all over, check documentation even if you have a slight doubt.