Created
August 15, 2012 04:07
-
-
Save hydra35/3355765 to your computer and use it in GitHub Desktop.
parse raw bash histroy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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