From 0dca716594ca542a7bedd0cd7037576ee4c72921 Mon Sep 17 00:00:00 2001 From: tdro Date: Sat, 21 Jan 2023 03:36:24 -0500 Subject: .local/bin/bashhistory: Silence --- .local/bin/bashhistory | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.local/bin/bashhistory b/.local/bin/bashhistory index 73d8376..a0f8300 100755 --- a/.local/bin/bashhistory +++ b/.local/bin/bashhistory @@ -7,9 +7,9 @@ current="$HISTFILE" lockfile='/tmp/bashhistory_Ri5ki9ei.lock' _prune() { - sed --in-place '/^#/d' "$1" && # Remove all timestamps. - sed --in-place '/.........../!d' "$1" && # Remove all commands less than 11 characters. - sort --unique "$1" > "$1.tmp" && mv --force "$1.tmp" "$1" # Remove all duplicate entries. + sed --in-place '/^#/d' "$1" && # Remove all timestamps. + sed --in-place '/.........../!d' "$1" && # Remove all commands less than 11 characters. + sort --unique "$1" > "$1.tmp" && mv --force "$1.tmp" "$1" > /dev/null 2>&1 # Remove all duplicate entries. } _migrate() { @@ -31,7 +31,7 @@ _store() { mkdir --parents "$directory" touch "$current" "$lockfile" -trap 'rm "$lockfile"; trap - EXIT; exit' EXIT INT HUP +trap 'rm "$lockfile" > /dev/null 2>&1; trap - EXIT; exit' EXIT INT HUP _migrate || true _store -- cgit v1.2.3