]> git.lizzy.rs Git - rust.git/blobdiff - src/etc/cat-and-grep.sh
Enforce Tuple trait on Fn traits
[rust.git] / src / etc / cat-and-grep.sh
index 08de25a77783a89efb8fe6084c09abd37a3b7db0..238f7f5b660277aa23c6715c3f20f29c08601410 100755 (executable)
@@ -51,10 +51,7 @@ while getopts ':vieh' OPTION; do
     esac
 done
 
-# an utility function to check if a string contains a substring
-stringContain() { [ -z "$1" ] || { [ -z "${2##*$1*}" ] && [ -n "$2" ];};}
-
-if ! stringContain 'E' "$GREPFLAGS"
+if ! echo "$GREPFLAGS" | grep -q E
 then
     # use F flag if there is not an E flag
     GREPFLAGS="F$GREPFLAGS"