Guest User

Untitled

a guest
Jun 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. $ declare -f shell_session_history_check
  2. shell_session_history_check ()
  3. {
  4. if [ ${SHELL_SESSION_DID_HISTORY_CHECK:-0} -eq 0 ]; then
  5. SHELL_SESSION_DID_HISTORY_CHECK=1;
  6. if shell_session_history_allowed; then
  7. shell_session_history_enable;
  8. fi;
  9. if [ "$PROMPT_COMMAND" = "shell_session_history_check" ]; then
  10. unset PROMPT_COMMAND;
  11. else
  12. if [[ $PROMPT_COMMAND =~ (.*)(; *shell_session_history_check *| *shell_session_history_check *; *)(.*) ]]; then
  13. PROMPT_COMMAND="${BASH_REMATCH[1]}${BASH_REMATCH[3]}";
  14. fi;
  15. fi;
  16. fi
  17. }
  18.  
  19. $ declare -f shell_session_history_enable
  20. shell_session_history_enable ()
  21. {
  22. ( umask 077;
  23. /usr/bin/touch "$SHELL_SESSION_HISTFILE_NEW" );
  24. HISTFILE="$SHELL_SESSION_HISTFILE_NEW";
  25. SHELL_SESSION_HISTORY=1
  26. }
Add Comment
Please, Sign In to add comment