Last active
November 25, 2022 18:46
-
-
Save tmiland/ec30ca392ec53520dbbfccb9012046ee to your computer and use it in GitHub Desktop.
Script to import zsh history to bashhub server
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/env bash | |
# Execution time was ca. 50 minutes for 10000 lines | |
# Cleans out everything before ; e.g ": 1548515910:0;" | |
cat $HOME/.zsh_history | cut -d \; -f 2 | uniq > $HOME/.zsh_history_clean | |
# Cleaned tmpfile | |
filename=$HOME/.zsh_history_clean | |
# Do the work | |
while read -r line; do | |
bashhub save "${line}" / 0 0 0; | |
echo "${line}"; | |
done < $filename | |
# Delete tmpfile | |
rm $filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment