Skip to content

Instantly share code, notes, and snippets.

@brianhillz0r
Forked from hydra35/parse_bash_history.rb
Created May 16, 2014 18:40
Show Gist options
  • Save brianhillz0r/7ffae1e77c5fe4ad476c to your computer and use it in GitHub Desktop.
Save brianhillz0r/7ffae1e77c5fe4ad476c to your computer and use it in GitHub Desktop.
file = ARGV[0]
File.readlines(file).each do |line|
if /^#(\d+)/.match(line)
ts = Regexp.last_match(1)
print Time.at(ts.to_i).to_s + " "
else
puts line
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment