Thursday, 15 April 2010

Perl one liner: Command Line Google

I stumbled across this really cool perl one liner here while looking for something else.

function google () {     u=`perl -MURI::Escape -wle 'print "http://google.com/search?q=".
    uri_escape(join " ",  @ARGV)' $@`;     links $u; }
Add this to your .bashrc file and then you can just google at the command line!
 For example :

google cambridge weather

You may have to change links to be w3m or lynx depending on which text browsers you have on your system.

I will probably never ever use this, but I feel happier knowing that I can

No comments:

Post a Comment