aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/hgrep.bash
blob: 0c31a213d88e0abdd2146aaefdee56614f561afd (plain) (blame)
1
2
3
4
5
6
7
8
9
# Search shell history file for a pattern. If you put your whole HISTFILE
# contents into memory, then you probably don't need this, as you can just do:
#
#     $ history | grep PATTERN
#
hgrep() {
    grep -- "${@:?}" "${HISTFILE:?}"
}