Tips for golfing in Bash What general tips do you have for golfing in Bash? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Bash (e.g. "remove comments" is not an answer). Please post one tip per answer.
Undocumented, but works in every version I've run into for legacy sh backwards compatibility:

for loops allow you to use { } instead of do done.  E.g. replace:



for i in {1..10};do echo $i; done


with:

for i in {1..10};{ echo $i;}