Skip to content

Commit 6135aff

Browse files
committed
simplify
1 parent 43bcc71 commit 6135aff

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/etc/cat-and-grep.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ while getopts ':vieh' OPTION; do
5151
esac
5252
done
5353

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"
54+
if ! echo "$GREPFLAGS" | grep -q E
5855
then
5956
# use F flag if there is not an E flag
6057
GREPFLAGS="F$GREPFLAGS"

0 commit comments

Comments
 (0)