This commit is contained in:
kxxt 2022-09-26 21:56:08 +08:00
parent 43bcc71d07
commit 6135aff27c
No known key found for this signature in database
GPG Key ID: 6F3B98D42FC6C9D8

View File

@ -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"