diff options
author | tdro <tdro@users.noreply.github.com> | 2023-01-21 03:36:24 -0500 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2023-01-21 03:36:24 -0500 |
commit | 0dca716594ca542a7bedd0cd7037576ee4c72921 (patch) | |
tree | e27ed5828de6b5420e332fa1a545def6d600c8e4 | |
parent | b5f761a4c8bf225c25c4ee7665cb8ca0c6bb7e38 (diff) | |
download | dotfiles-0dca716594ca542a7bedd0cd7037576ee4c72921.tar.gz dotfiles-0dca716594ca542a7bedd0cd7037576ee4c72921.tar.bz2 dotfiles-0dca716594ca542a7bedd0cd7037576ee4c72921.zip |
.local/bin/bashhistory: Silence
-rwxr-xr-x | .local/bin/bashhistory | 8 |
1 files 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 |