diff --git a/programs/zsh-histclean/histclean b/programs/zsh-histclean/histclean index 2de032b..677b89a 100755 --- a/programs/zsh-histclean/histclean +++ b/programs/zsh-histclean/histclean @@ -1,11 +1,14 @@ #!/usr/bin/env zsh +echo 'Starting history size:' +ls -lh ~/.cache/zsh-histfile | cut -d " " -f5 + hist=() while IFS= read -r line; do if [[ $line == "./"* || $line == "/"* ]]; then hist+=($line) - else + elif [[ $line != "histclean" ]]; then which $(echo $line | cut -d " " -f1) > /dev/null [[ $? == 0 ]] && hist+=($line) fi @@ -15,3 +18,6 @@ echo -n "" > "$XDG_CACHE_HOME"/zsh-histfile for item in "${hist[@]}"; do echo "$item" >> "$XDG_CACHE_HOME"/zsh-histfile done + +echo 'Ending history size:' +ls -lh ~/.cache/zsh-histfile | cut -d " " -f5