/.bashrc Secret
Created
February 28, 2024 00:40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FIRST_PROMPT=1 | |
muh_history() { | |
# First prompt of a new session, don't log | |
[ -n "$FIRST_PROMPT" ] && { | |
unset FIRST_PROMPT | |
return | |
} | |
local hist | |
hist=$(history 1 | { read -r _ cmd; echo "$cmd"; }) | |
echo "$$ $PWD $USER $hist" >> "$HOME/.muh_history" | |
} | |
PROMPT_COMMAND=muh_history |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment