Skip to content

Instantly share code, notes, and snippets.

@basicxman
Created August 7, 2011 06:00
Show Gist options
  • Select an option

  • Save basicxman/1130105 to your computer and use it in GitHub Desktop.

Select an option

Save basicxman/1130105 to your computer and use it in GitHub Desktop.
Code Kata in Bash or "I get crazy at 2AM"
#!/bin/bash
# http://codekata.pragprog.com/2007/01/kata_four_data_.html
awk '{print (($7 - $9) < 0 ? -($7 - $9) : $7 - $9) " " $2}' football.dat | grep -P "[A-Za-z_]{2,}" | sort -n | head -n 1 | awk '{print $2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment