Tips for golfing in Bash Bash Reference Manual Basic tips Use for …;{ …;} instead of for …;do …;done Use $[…] instead of $((…)) for arithmetic expansion Try to use && or || instead of if : is a short command that does nothing history -p prints each argument on a new line Unset variables evaluate to 0 in arithmetic expressions