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.
By Matthew
|
Posted in Uncategorized
|
Also tagged code
|
October 14, 2004 – 8:33 pm
A sprinkle of this and a sprinkle of that(ssh -D 8000 remote.com)
Discovered a nasty bug which looks related to Perl 5.8, SOAPLite, LDAP and UTF8. We have a SOAPLite SOAP RPC that connects to an LDAP server to do authentication. It looks like this combination of tools mangles the utf8 encoding of the parameters passed to the LDAP calls. managed to find [...]