commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
This is a quick and dirty way of creating key/value pairs in bash. Not as flexible as an associative array, but often powerful enough to be useful. For example, if I want to rename sets of files in a way that I can't do with wildcards, I'll create something like 'rename-me.txt'
Then I'll traverse rename-me.txt with a read loop
cat rename-me.txt | while read line;
mv $old $new;
There is 1 alternative - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.