Skip to content

Instantly share code, notes, and snippets.

@rbricheno
Created July 30, 2019 14:47
Show Gist options
  • Save rbricheno/a799c2ba31c7669b2706c49e93b0300b to your computer and use it in GitHub Desktop.
Save rbricheno/a799c2ba31c7669b2706c49e93b0300b to your computer and use it in GitHub Desktop.
BBC news in the terminal
curl -s http://feeds.bbci.co.uk/news/rss.xml?edition=uk | grep '<description>' | cut -f3 -d "[" | cut -f1 -d "]"
@rbricheno
Copy link
Author

And why not make it more readable, with awk?

curl -s http://feeds.bbci.co.uk/news/rss.xml?edition=uk | grep '<description>' | cut -f3 -d "[" | cut -f1 -d "]" | head -6 | tail -5 | awk 'NR == 1 {print ""}; sub(/^/, " "); {print ""}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment