This file contains hidden or 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
#!/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 |