Skip to content

Instantly share code, notes, and snippets.

@jparker
Created January 16, 2011 22:15
Show Gist options
  • Save jparker/782206 to your computer and use it in GitHub Desktop.
Save jparker/782206 to your computer and use it in GitHub Desktop.
for ((i=0; $i<100; i++)); do time -p cap -q uptime; done 2>&1 | \
ruby -pe '
BEGIN { puts %q["real","user","sys"] }
$_.sub!(/(?:real|user) (.*)\n$/, "\\1,")
$_.sub!(/(?:sys) (.*)/, "\\1")
' | tee out.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment