From 09c737daf76b15d0baafb1681c6abe5c5025a64d Mon Sep 17 00:00:00 2001 From: urosm Date: Fri, 13 Sep 2024 20:23:18 +0200 Subject: [PATCH] .profile: sort HISTFILE --- .profile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.profile b/.profile index 943bf6d..e0b97ba 100644 --- a/.profile +++ b/.profile @@ -28,9 +28,8 @@ export XDG_CONFIG_DIRS=/etc/xdg # .bash_history export HISTFILE="$XDG_STATE_HOME"/bash/history -if [ ! -d "$(dirname "${HISTFILE}")" ]; then - mkdir -p "$(dirname "${HISTFILE}")" -fi +[ ! -d "$(dirname "${HISTFILE}")" ] && mkdir -p "$(dirname "${HISTFILE}")" +[ -f "$HISTFILE" ] && sort -uo $HISTFILE $HISTFILE # .inputrc export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc