This feed contains pages tagged "shell".

To fetch the link for old harry's game:

$ wget -q -O - http://www.bbc.co.uk/iplayer/console/b007jpd8 | \
link.pl | grep ".ram$" | head -1

To fetch from the link in the clipboard, and place the answer in the clipboard:

$ wget -q -O - $(xclip -o) | link.pl | grep ".ram$" | head -1 | xclip -i

Replacing link.pl and the grep with sed:

$ wget -q -O - $URL | sed -e '/http/!d' -e 's/.*http:\/\/\([^ \"]*\).*/\1/g' -e '/.ram$/!d' | head -1

See also bbcplay.

Attachments:

  1. ?link.pl
Posted Mon 19 Oct 2009 12:44:54 BST Tags: shell

The output of /sbin/route contains the default network interface:

route | grep "^default" | awk '{print $8}'

Attachments:

Posted Mon 19 Oct 2009 12:44:54 BST Tags: shell

Rather than using cut and grep (to find files present locally, but not checked in):

svk status | grep "^\?" | cut -d " " -f 2

You can use awk:

svk status | awk '/^\?/ {print $2;}'

Or sed:

svk status | sed -e '/^?/!d' -e 's/^?\s*//'

Or, just for fun, perl:

svk status | perl -ne 'print $1."\n" if /^\?\s*(.*)/'
Posted Mon 19 Oct 2009 12:44:54 BST Tags: shell

Have a look in the RSS feed from the BBC weather centre:

wget -q -O - http://feeds.bbc.co.uk/weather/feeds/rss/5day/id/1671.xml \
| sed -e '/Sunset/!d'|sed -e 's/^.*Sunset: \(.*\)GMT.*$/\1/' | head -1

Replace 1671.xml with whereever you are.

Posted Mon 19 Oct 2009 12:44:54 BST Tags: shell