Skip to content

Instantly share code, notes, and snippets.

@davidjbeveridge
Created August 15, 2011 00:08
Show Gist options
  • Save davidjbeveridge/1145490 to your computer and use it in GitHub Desktop.
Save davidjbeveridge/1145490 to your computer and use it in GitHub Desktop.
wtf.sh

wtf.sh

A simple search for when you find yourself typing wtf on the command line. Works on mac.

Instructions

Put this somewhere in your path, make it executable, and either rename it to wtf, or create a symlink. Then, whenever you type wtf on the command line, you'll actually get something.

#!/bin/bash
# allows you to use wtf.sh to google whatever you just did that didn't work.
open "`history | tail -2 | head -1 | awk '{ print "http://google.com/search?q=",$2,$3,$4,$5,$6,$7,$8,$9,$10,$11 }'`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment