[Gllug] bash-tips, learning styles and lofty pursuits

Matthew King matthew.king at monnsta.net
Mon Apr 19 08:22:19 UTC 2010


"general_email at technicalbloke.com" <general_email at technicalbloke.com>
writes:

> That last one been copied into my "Useful CLI" file already, happy days :)

Well while you're at it, a few variations while I avoid getting the day
started:

They can be embedded, and '' is a viable string:
$ echo ab{,-{c,d}}
ab ab-c ab-d

They can contain globs:
$ touch abc a-foo-c a-bar-c
$ ls a{b,-*-}c
abc a-bar-c a-foo-c

And variables:
$ x=foo
$ ls a{b,-$x-}c
abc a-foo-c

They can be passed through ssh too, but then escaping gets involved and
it becomes a whole lot less fun.

Matthew

-- 
I must take issue with the term "a mere child", for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list