[Open-scap] [PATCH 04/17] Global replace of grep -q

Marshall Miller mmiller at tresys.com
Wed Jul 13 20:41:42 UTC 2011


Replaced grep -q with grep >/dev/null because grep on Solaris does not support -q
---
 .../test_probes_environmentvariable.sh             |   16 ++++++------
 tests/probes/family/test_probes_family.sh          |   16 ++++++------
 tests/probes/file/test_probes_file.sh              |   16 ++++++------
 tests/probes/filehash/test_probes_filehash.sh      |   16 ++++++------
 tests/probes/filemd5/test_probes_filemd5.sh        |   16 ++++++------
 tests/probes/interface/test_probes_interface.sh    |   16 ++++++------
 tests/probes/password/test_probes_password.sh      |   16 ++++++------
 tests/probes/process/test_probes_process.sh        |   16 ++++++------
 tests/probes/rpminfo/test_probes_rpminfo.sh        |   16 ++++++------
 tests/probes/runlevel/test_probes_runlevel.sh      |   24 ++++++++++----------
 tests/probes/shadow/test_probes_shadow.sh          |   16 ++++++------
 .../test_probes_textfilecontent54.sh               |   16 ++++++------
 tests/probes/uname/test_probes_uname.sh            |   16 ++++++------
 13 files changed, 108 insertions(+), 108 deletions(-)

diff --git a/tests/probes/environmentvariable/test_probes_environmentvariable.sh b/tests/probes/environmentvariable/test_probes_environmentvariable.sh
index effd31a..4108e32 100755
--- a/tests/probes/environmentvariable/test_probes_environmentvariable.sh
+++ b/tests/probes/environmentvariable/test_probes_environmentvariable.sh
@@ -34,17 +34,17 @@ function test_probes_environmentvariable {
 	DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:1\""`
 	DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:1\""`
 
-	if (echo $DEF_RES | grep -q "result=\"true\""); then
+	if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 	    RES="TRUE"
-	elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 	    RES="FALSE"
 	else
 	    RES="ERROR"
 	fi
 	
-	if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 	    CMT="TRUE"
-	elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 	    CMT="FALSE"
 	else
 	    CMT="ERROR"
@@ -61,17 +61,17 @@ function test_probes_environmentvariable {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/family/test_probes_family.sh b/tests/probes/family/test_probes_family.sh
index 3d736f9..85f0dfb 100755
--- a/tests/probes/family/test_probes_family.sh
+++ b/tests/probes/family/test_probes_family.sh
@@ -39,17 +39,17 @@ function test_probes_family {
 	    DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:\${ID}\""`
 	    DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:${ID}\""`
 
-	    if (echo $DEF_RES | grep -q "result=\"true\""); then
+	    if (echo $DEF_RES | grep "result=\"true\"") >/dev/null; then
 		RES="TRUE"
-	    elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	    elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	    if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
@@ -69,17 +69,17 @@ function test_probes_family {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/file/test_probes_file.sh b/tests/probes/file/test_probes_file.sh
index 97ee247..10bcc0f 100755
--- a/tests/probes/file/test_probes_file.sh
+++ b/tests/probes/file/test_probes_file.sh
@@ -38,17 +38,17 @@ function test_probes_file {
 	    DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:\${ID}\""`
 	    DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:${ID}\""`
 
-	    if (echo $DEF_RES | grep -q "result=\"true\""); then
+	    if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	    elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	    if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
@@ -68,17 +68,17 @@ function test_probes_file {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/filehash/test_probes_filehash.sh b/tests/probes/filehash/test_probes_filehash.sh
index 5b56acd..e276ea9 100755
--- a/tests/probes/filehash/test_probes_filehash.sh
+++ b/tests/probes/filehash/test_probes_filehash.sh
@@ -52,17 +52,17 @@ function test_probes_filehash {
 	    DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:${ID}\""`
 	    DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:${ID}\""`
 
-	    if (echo $DEF_RES | grep -q "result=\"true\""); then
+	    if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	    elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	    if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
@@ -82,17 +82,17 @@ function test_probes_filehash {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/filemd5/test_probes_filemd5.sh b/tests/probes/filemd5/test_probes_filemd5.sh
index 1d50372..775c616 100755
--- a/tests/probes/filemd5/test_probes_filemd5.sh
+++ b/tests/probes/filemd5/test_probes_filemd5.sh
@@ -46,17 +46,17 @@ function test_probes_filemd5 {
 	    DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:${ID}\""`
 	    DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:${ID}\""`
 
-	    if (echo $DEF_RES | grep -q "result=\"true\""); then
+	    if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	    elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	    if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
@@ -76,17 +76,17 @@ function test_probes_filemd5 {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/interface/test_probes_interface.sh b/tests/probes/interface/test_probes_interface.sh
index 8e39022..7f094d0 100755
--- a/tests/probes/interface/test_probes_interface.sh
+++ b/tests/probes/interface/test_probes_interface.sh
@@ -45,17 +45,17 @@ function test_probes_interface {
 	DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:1\""`
 	DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:1\""`
 
-	if (echo $DEF_RES | grep -q "result=\"true\""); then
+	if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 	    RES="TRUE"
-	elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 	    RES="FALSE"
 	else
 	    RES="ERROR"
 	fi
 	
-	if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 	    CMT="TRUE"
-	elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 	    CMT="FALSE"
 	else
 	    CMT="ERROR"
@@ -72,17 +72,17 @@ function test_probes_interface {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/password/test_probes_password.sh b/tests/probes/password/test_probes_password.sh
index 04d4f01..cab67d3 100755
--- a/tests/probes/password/test_probes_password.sh
+++ b/tests/probes/password/test_probes_password.sh
@@ -43,17 +43,17 @@ function test_probes_password {
 	DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:1\""`
 	DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:1\""`
 
-	if (echo $DEF_RES | grep -q "result=\"true\""); then
+	if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 	    RES="TRUE"
-	elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 	    RES="FALSE"
 	else
 	    RES="ERROR"
 	fi
 	
-	if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 	    CMT="TRUE"
-	elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 	    CMT="FALSE"
 	else
 	    CMT="ERROR"
@@ -70,17 +70,17 @@ function test_probes_password {
 	    TST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TST_RES | grep -q "result=\"true\""); then
+	    if (echo $TST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/process/test_probes_process.sh b/tests/probes/process/test_probes_process.sh
index 3394ab8..1619586 100755
--- a/tests/probes/process/test_probes_process.sh
+++ b/tests/probes/process/test_probes_process.sh
@@ -38,17 +38,17 @@ function test_probes_process {
 	DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:1\""`
 	DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:1\""`
 
-	if (echo $DEF_RES | grep -q "result=\"true\""); then
+	if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 	    RES="TRUE"
-	elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 	    RES="FALSE"
 	else
 	    RES="ERROR"
 	fi
 	
-	if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 	    CMT="TRUE"
-	elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 	    CMT="FALSE"
 	else
 	    CMT="ERROR"
@@ -65,17 +65,17 @@ function test_probes_process {
 	    TST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TST_RES | grep -q "result=\"true\""); then
+	    if (echo $TST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/rpminfo/test_probes_rpminfo.sh b/tests/probes/rpminfo/test_probes_rpminfo.sh
index d990e05..a616f9e 100755
--- a/tests/probes/rpminfo/test_probes_rpminfo.sh
+++ b/tests/probes/rpminfo/test_probes_rpminfo.sh
@@ -49,17 +49,17 @@ function test_probes_rpminfo {
 	    DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:${ID}\""`
 	    DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:${ID}\""`
 
-	    if (echo $DEF_RES | grep -q "result=\"true\""); then
+	    if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	    elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	    if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
@@ -79,17 +79,17 @@ function test_probes_rpminfo {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/runlevel/test_probes_runlevel.sh b/tests/probes/runlevel/test_probes_runlevel.sh
index e179928..b81ba84 100755
--- a/tests/probes/runlevel/test_probes_runlevel.sh
+++ b/tests/probes/runlevel/test_probes_runlevel.sh
@@ -45,17 +45,17 @@ function test_probes_runlevel_A {
 		    TEST_DEF=`grep "id=\"oval:${S}-${LEVEL}-${STATE}-${SUFFIX}:tst:1\"" $DEFFILE`
 		    TEST_RES=`grep "test_id=\"oval:${S}-${LEVEL}-${STATE}-${SUFFIX}:tst:1\"" $RESFILE`
 
-		    if (echo $TEST_RES | grep -q "result=\"true\""); then
+		    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 			RES="TRUE"
-		    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+		    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 			RES="FALSE"
 		    else
 			RES="ERROR"
 		    fi
 		    
-		    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+		    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 			CMT="TRUE"
-		    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+		    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 			CMT="FALSE"
 		    else
 			CMT="ERROR"
@@ -105,17 +105,17 @@ function test_probes_runlevel_B {
 	    DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:${ID}\""`
 	    DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:${ID}\""`
 
-	    if (echo $DEF_RES | grep -q "result=\"true\""); then
+	    if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	    elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	    if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
@@ -135,17 +135,17 @@ function test_probes_runlevel_B {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"test:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"test:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/shadow/test_probes_shadow.sh b/tests/probes/shadow/test_probes_shadow.sh
index 4b3c867..9292e8f 100755
--- a/tests/probes/shadow/test_probes_shadow.sh
+++ b/tests/probes/shadow/test_probes_shadow.sh
@@ -43,17 +43,17 @@ function test_probes_shadow {
 	DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:1\""`
 	DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:1\""`
 
-	if (echo $DEF_RES | grep -q "result=\"true\""); then
+	if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 	    RES="TRUE"
-	elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 	    RES="FALSE"
 	else
 	    RES="ERROR"
 	fi
 	
-	if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 	    CMT="TRUE"
-	elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 	    CMT="FALSE"
 	else
 	    CMT="ERROR"
@@ -70,17 +70,17 @@ function test_probes_shadow {
 	    TST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TST_RES | grep -q "result=\"true\""); then
+	    if (echo $TST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/textfilecontent54/test_probes_textfilecontent54.sh b/tests/probes/textfilecontent54/test_probes_textfilecontent54.sh
index 041174e..1712a4c 100755
--- a/tests/probes/textfilecontent54/test_probes_textfilecontent54.sh
+++ b/tests/probes/textfilecontent54/test_probes_textfilecontent54.sh
@@ -49,17 +49,17 @@ function test_probes_textfilecontent54 {
 	    DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:0:def:${ID}\""`
 	    DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:0:def:${ID}\""`
 
-	    if (echo $DEF_RES | grep -q "result=\"true\""); then
+	    if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	    elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	    if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
@@ -79,17 +79,17 @@ function test_probes_textfilecontent54 {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"oval:0:tst:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"oval:0:tst:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
diff --git a/tests/probes/uname/test_probes_uname.sh b/tests/probes/uname/test_probes_uname.sh
index 835a629..1f4bbad 100755
--- a/tests/probes/uname/test_probes_uname.sh
+++ b/tests/probes/uname/test_probes_uname.sh
@@ -46,17 +46,17 @@ function test_probes_uname {
 	    DEF_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:def:${ID}\""`
 	    DEF_RES=`cat "$RESFILE" | grep "definition_id=\"oval:1:def:${ID}\""`
 
-	    if (echo $DEF_RES | grep -q "result=\"true\""); then
+	    if (echo $DEF_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $DEF_RES | grep -q "result=\"false\""); then
+	    elif (echo $DEF_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $DEF_DEF | grep -q "comment=\"true\""); then
+	    if (echo $DEF_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $DEF_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $DEF_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
@@ -76,17 +76,17 @@ function test_probes_uname {
 	    TEST_DEF=`cat "$DEFFILE" | grep "id=\"oval:1:tst:${ID}\""`
 	    TEST_RES=`cat "$RESFILE" | grep "test_id=\"oval:1:tst:${ID}\""`
 
-	    if (echo $TEST_RES | grep -q "result=\"true\""); then
+	    if (echo $TEST_RES | grep "result=\"true\"" >/dev/null); then
 		RES="TRUE"
-	    elif (echo $TEST_RES | grep -q "result=\"false\""); then
+	    elif (echo $TEST_RES | grep "result=\"false\"" >/dev/null); then
 		RES="FALSE"
 	    else
 		RES="ERROR"
 	    fi
 
-	    if (echo $TEST_DEF | grep -q "comment=\"true\""); then
+	    if (echo $TEST_DEF | grep "comment=\"true\"" >/dev/null); then
 		CMT="TRUE"
-	    elif (echo $TEST_DEF | grep -q "comment=\"false\""); then
+	    elif (echo $TEST_DEF | grep "comment=\"false\"" >/dev/null); then
 		CMT="FALSE"
 	    else
 		CMT="ERROR"
-- 
1.6.2.5




More information about the Open-scap-list mailing list