Avoid test with no arguments and unnecessary subshell

This commit is contained in:
Tom "Ravi" Hale
2018-08-17 12:49:07 +07:00
parent 4c95bafbd3
commit 77b1717008

View File

@@ -5,9 +5,9 @@
# ------------------------------------------------------------------------------
if test | sed -E 's///g' 2>/dev/null; then
if sed -E 's///g' </dev/null &>/dev/null; then
SED_REGEX_ARG="E"
elif test | sed -r 's///g' 2>/dev/null; then
elif sed -r 's///g' </dev/null &>/dev/null; then
SED_REGEX_ARG="r"
else
echo "Cannot determine extended regex argument for sed! (Doesn't respond to either -E or -r)"