We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5819f41 + 6135aff commit f72d76dCopy full SHA for f72d76d
src/etc/cat-and-grep.sh
@@ -26,7 +26,7 @@ Options:
26
-i Case insensitive search.
27
'
28
29
-GREPPER=fgrep
+GREPPER=grep
30
INVERT=0
31
GREPFLAGS='q'
32
while getopts ':vieh' OPTION; do
@@ -39,7 +39,7 @@ while getopts ':vieh' OPTION; do
39
GREPFLAGS="i$GREPFLAGS"
40
;;
41
e)
42
- GREPPER=egrep
+ GREPFLAGS="E$GREPFLAGS"
43
44
h)
45
echo "$USAGE"
@@ -51,6 +51,12 @@ while getopts ':vieh' OPTION; do
51
esac
52
done
53
54
+if ! echo "$GREPFLAGS" | grep -q E
55
+then
56
+ # use F flag if there is not an E flag
57
+ GREPFLAGS="F$GREPFLAGS"
58
+fi
59
+
60
shift $((OPTIND - 1))
61
62
# use gnu version of tool if available (for bsd)
0 commit comments