aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/hgrep.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/shrc.d/hgrep.sh')
-rw-r--r--sh/shrc.d/hgrep.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/sh/shrc.d/hgrep.sh b/sh/shrc.d/hgrep.sh
index 1c4c3ec5..fe297ab3 100644
--- a/sh/shrc.d/hgrep.sh
+++ b/sh/shrc.d/hgrep.sh
@@ -6,11 +6,11 @@
hgrep() {
if [ "$#" -eq 0 ] ; then
printf >&2 'hgrep(): Need a pattern\n'
- exit 2
+ return 2
fi
- if ! [ -n "$HISTFILE" ] ; then
+ if [ -z "$HISTFILE" ] ; then
printf >&2 'hgrep(): No HISTFILE\n'
- exit 2
+ return 2
fi
grep "$@" "$HISTFILE"
}