We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43bcc71 commit 6135affCopy full SHA for 6135aff
src/etc/cat-and-grep.sh
@@ -51,10 +51,7 @@ while getopts ':vieh' OPTION; do
51
esac
52
done
53
54
-# an utility function to check if a string contains a substring
55
-stringContain() { [ -z "$1" ] || { [ -z "${2##*$1*}" ] && [ -n "$2" ];};}
56
-
57
-if ! stringContain 'E' "$GREPFLAGS"
+if ! echo "$GREPFLAGS" | grep -q E
58
then
59
# use F flag if there is not an E flag
60
GREPFLAGS="F$GREPFLAGS"
0 commit comments