27/03/2009
commandlinefu.com random entry parser
I’ve written a small perl script to parse random entries from the extremely usefull commandlinefu.com website. Quoting from their site:
Command-Line-Fu is the place to record those command-line gems that you return to again and again.
The script code is very “clean”. I can almost say that it’s written in a very python-ish way.
Sample output:%./cfu.pl
CMD: for (( i = 0; i < 100; i++ )); do echo "$i"; done
URL=http://www.commandlinefu.com/commands/view/735/perform-a-c-style-loop-in-bash. Title=Perform a C-style loop in Bash.
Description: Print 0 through 99, each on a separate line.
%./cfu.pl
CMD: rsync -av -e ssh user@host:/path/to/file.txt .
URL=http://www.commandlinefu.com/commands/view/20/synchronise-a-file-from-a-remote-server Title=Synchronise a file from a remote server
Description: You will be prompted for a password unless you have your public keys set-up.
You can get it from here: commandlinefu.com random entry parser perl script
As far as I’ve tested, it works out of the box on default perl installations of Debian, Gentoo and Mac OS X.
Filed by kargig at 01:28 under Gentoo,Internet,Linux,MacOSX
Tags: commandlinefu, debian, Gentoo, MacOSX, oneliner, parse, perl, script
3 Comments | 11,690 views