re: Bash from scratch: learn enough bash to write your own scripts VIEW POST


Instead of referring to some online articles on test conditions, you can just check out man test.

Conditions and most other such things are good to shorthand a bit, and if you're planning on using BASH use [[ ... ]] instead of [ ... ] as they also function differently. Stick to one style for predictability.

Slightly compacted formats

if [[ "$FOO" == "1" ]]; then

for i in 1 2 3 4; do
  echo $i

while [[ true ]]; do

Also is an excellent resource to use to check your scripts for common bugs etc. There's even a decent unit testing framework for BASH scripts nowadays:


This is fantastic! Iā€™m still new to bash scripting :) but will include this in the article. Great feedback!!


I have updated the post, thank you again for the feedback!

code of conduct - report abuse