Came across a great new shell tip. Brace expansion.
Some examples:
$echo {one,two,three,four}" fish"
one fish two fish three fish four fish
$ echo {{1,2,3}1,2,3}
11 21 31 2 3
Ok, that’s great. What’s it good for:
$ cp /tmp/test.html /tmp/test.html_bak
Can be rewritten as:
cp /tmp/test.html{,_bak}
Then after you makes some changes to /tmp/test.html:
$ diff /tmp/test.html{_bak,}
Works in bash, zsh and possibly others.



3 Comments
Brace expansion works in every shell known to me. There might be some enhanced iterative features in bash though.
-n
well do I remember your icon! Been to JDs lately? I remember when we went to that place all the time, then suddenly, no more!
We make the trek at least twice a month these days.