Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. # Continuous, continuously-updated history guff:
  2. HFN="${HOME}/.history/$(date -u +%Y/%m/%d/%H.%M.%S)_${HOSTNAME}_$$"
  3. mkdir -p `dirname $HFN`
  4. if [ ! -e $HFN ]; then
  5.         history -r ${HOME}/.history/template
  6. fi
  7. HISTFILE=$HFN
  8.  
  9. hgrep() {
  10.         grep -h "$@" ${HOME}/.history/*/*/*/* | tac
  11. }
  12.  
  13. Hgrep() {
  14.         grep "$@" ${HOME}/.history/*/*/*/* | tac
  15. }
  16.  
  17. PROMPT_COMMAND='history -w ${HISTFILE}_tmp; mv ${HISTFILE}_tmp ${HISTFILE}'
  18. HISTFILESIZE=-1
  19. HISTSIZE=-1
  20. HISTCONTROL=ignoredups
  21. # end histfile.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement