Last active
July 9, 2016 21:22
-
-
Save edgardleal/33495742fdf5da786e6bfe5b0383036b to your computer and use it in GitHub Desktop.
Import bash_history to your zshell history file ( ~/.zsh_history )
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
#!/bin/bash - | |
#title :import_bash_history_to_zshell.sh | |
#description :This script import all commands history finded in ~/.bash_history to ~/.zsh_history in zshell format | |
#author :Edgard Leal <[email protected]> | |
#date :20160705 | |
#version :0.1 | |
#usage :bash import_bash_history_to_zshell.sh | |
#notes : | |
#bash_version :4.1.5(1)-release | |
#============================================================================== | |
set -eu | |
declare -r bash_file="${HOME}/.bash_history" | |
export zsh_file="${HOME}/.zsh_history" | |
# get epoc time | |
export time="$(date +%s)" | |
cat "$bash_file" | xargs -0 -I@ echo ": $(($time +1)):0;@" >> $zsh_file | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To run without create a file:
curl https://gist.githubusercontent.com/edgardleal/33495742fdf5da786e6bfe5b0383036b/raw/eb55a035b85416f9b2ca2fe7ff6bd0de164514f7/import_bash_history_to_zshell_history.sh | bash