Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created October 3, 2013 08:12
Show Gist options
  • Save jugyo/6806782 to your computer and use it in GitHub Desktop.
Save jugyo/6806782 to your computer and use it in GitHub Desktop.
# Usage: cat .zhistory | ruby zsh_history_to_bash_history.rb >> .bash_history
history = ARGF.read.force_encoding('ascii-8bit')
history.split("\n").each do |line|
begin
puts line.split(';')[-1].strip
rescue
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment