Import bash history to zsh history

################################################################## = This script transfers bash history to zsh history# = Change bash and zsh history files, if you don't use defaults## = Usage: ruby bash_to_zsh_history.rb## = Author: Ankit Goyal################################################################## change if you don't use default valuesBASH_HISTORY_FILE_PATH="#{ENV['HOME']}/.bash_history"ZSH_HISTORY_FILE_PATH="#{ENV['HOME']}/.zsh_history"# Read the bash history filebash_hist_file=File.read(BASH_HISTORY_FILE_PATH)# Get the list of commands from bash history hilecommand_list=bash_hist_file.split("\n")# Open the zsh history filezsh_hist_file=File.open(ZSH_HISTORY_FILE_PATH,"a")# Get timestamp required for zsh history file format# and update the history filetime=Time.now.to_icommand_list.eachdo|command|time+=1zsh_hist_file.write(": #{time}:0;#{command}\n")end# Close the filezsh_hist_file.close