When setting an environment variable by piping something into grep, backquotes

can be useful.  Also tweak an if case to be more portable.
This commit is contained in:
Rob Landley 2006-02-16 09:00:57 +00:00
parent d1e38c07e6
commit 006fa2d45b

View File

@ -42,9 +42,9 @@ export SKIP=
optional()
{
option="$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"
option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"`
# Not set?
if [[ -z "$1" || -z "$OPTIONFLAGS" || ${#option} -ne 0 ]]
if [ -z "$1" ] || [ -z "$OPTIONFLAGS" ] || [ ${#option} -ne 0 ]
then
SKIP=""
return