Skip to content

Instantly share code, notes, and snippets.

@pierre
Created April 15, 2011 23:07
Show Gist options
  • Save pierre/922620 to your computer and use it in GitHub Desktop.
Save pierre/922620 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
if ARGV[0] == "-k"
orig_lines=`/bin/df #{ARGV.join(" ")}`.split("\n")
puts orig_lines[0]
orig_lines[1..-1].each do |line|
numbers_line = line.split()
numbers_line[1] = numbers_line[2].to_i + numbers_line[3].to_i
puts numbers_line.join(" ")
end
else
puts `/bin/df #{ARGV.join(" ")}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment