When setting an environment variable by piping something into grep, backquotes
authorRob Landley <rob@landley.net>
Thu, 16 Feb 2006 09:00:57 +0000 (09:00 -0000)
committerRob Landley <rob@landley.net>
Thu, 16 Feb 2006 09:00:57 +0000 (09:00 -0000)
can be useful.  Also tweak an if case to be more portable.

testsuite/testing.sh

index c1002a6aa8c6c1f0ea245171ca82c4ae88542570..f16f4c7e8de92a256645a7864adf3c83b051ae48 100755 (executable)
@@ -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