Skip to content

Instantly share code, notes, and snippets.

@spinal84
spinal84 / bash2zsh_hist.rb
Created March 14, 2023 06:50
Convert history files from bash to zsh and vice versa
#!/usr/bin/ruby
# Convert history files from bash to zsh and vice versa.
# Usage:
# cat ~/.bash_history | ruby bash2zsh_hist.rb > ~/.zsh_history
# cat ~/.zsh_history | ruby bash2zsh_hist.rb -r > ~/.bash_history
require 'set'
class Integer
# https://github.com/zsh-users/zsh/blob/dd13048b3b8cf710f44424ce9fedc2b56c31fde3/Src/utils.c#L4082-L4189