$ echo test_{foo,bar,baz}which is useful enough, but where it really shines is in sequence expansion. The idiomatic Bash For loop I've often seen is something like:
test_foo test_bar test_baz
$ for i in `seq 1 10`; do echo $i; donewhich is just nasty. Compare to:
$ for i in {1..10}; do echo $i; donewhich is nicer, but even more nice is:
$ echo {1..10} | tr ' ' '\n'(IMHO.)
And of course, something like this this comes in really handy:
$ wget www.somewhere.com/{a,b}{1..9}.jpgNot sure what I would use that for... ;)
No comments:
Post a Comment