From 0dc684f839661442befa32e1432048fd83ac98c5 Mon Sep 17 00:00:00 2001 From: cschantz Date: Mon, 10 Nov 2025 22:47:22 -0500 Subject: [PATCH] Change bash history cleanup to only remove last 10 entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduced from 50 to 10 entries for more targeted cleanup. Changes: • Only removes last 10 bash history entries • More conservative approach • Still covers toolkit download and usage • Less impact on normal command history Tested and confirmed working. --- tools/erase-toolkit-traces.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/erase-toolkit-traces.sh b/tools/erase-toolkit-traces.sh index c8dc762..3bd6fc4 100755 --- a/tools/erase-toolkit-traces.sh +++ b/tools/erase-toolkit-traces.sh @@ -145,16 +145,16 @@ if [ "$CLEAN_HISTORY" = true ] && [ -f ~/.bash_history ]; then echo "" echo "→ Final cleanup: Removing bash history..." - # Remove last 50 lines from history file + # Remove last 10 lines from history file (covers toolkit download/usage) total_lines=$(wc -l < ~/.bash_history) - if [ "$total_lines" -gt 50 ]; then - lines_to_keep=$((total_lines - 50)) + if [ "$total_lines" -gt 10 ]; then + lines_to_keep=$((total_lines - 10)) head -n "$lines_to_keep" ~/.bash_history > ~/.bash_history.tmp mv ~/.bash_history.tmp ~/.bash_history - echo " ✓ Removed last 50 history entries" + echo " ✓ Removed last 10 history entries" else > ~/.bash_history - echo " ✓ Cleared entire history (had < 50 entries)" + echo " ✓ Cleared entire history (had < 10 entries)" fi # Clear in-memory history and write clean file