diff options
author | Wanlong Gao <gaowanlong@cn.fujitsu.com> | 2012-07-26 11:03:21 +0800 |
---|---|---|
committer | Wanlong Gao <gaowanlong@cn.fujitsu.com> | 2012-07-26 21:27:46 +0800 |
commit | d2822079ea05fb19399d1a7413d4efea470fcd78 (patch) | |
tree | cf8d15380044f3645c108a519d186d4951c9e39b /testcases/commands | |
parent | f258398f5f10e260da9dc3a8f533ec51f917a221 (diff) |
file: use the grep -q option instead of redirection
Use grep -q option instead, as Cooper suggested.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Reviewed-by: Garrett Cooper <yanegomi@gmail.com>
Diffstat (limited to 'testcases/commands')
-rwxr-xr-x | testcases/commands/ade/file/file_test.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/testcases/commands/ade/file/file_test.sh b/testcases/commands/ade/file/file_test.sh index 8a4e9b58b..f415057e7 100755 --- a/testcases/commands/ade/file/file_test.sh +++ b/testcases/commands/ade/file/file_test.sh @@ -163,7 +163,7 @@ file $LTPTMP/test_file.txt > $LTPTMP/file.out 2>&1 if [ $? -eq 0 ] then - grep "ASCII text" $LTPTMP/file.out > /dev/null 2>&1 + grep -q "ASCII text" $LTPTMP/file.out if [ $? -eq 0 ] then $LTPBIN/tst_resm TPASS "file: Recognised ASCII file correctly" @@ -199,7 +199,7 @@ file $LTPTMP/bash_script.sh > $LTPTMP/file.out 2>&1 if [ $? -eq 0 ] then - grep "Bourne-Again shell script" $LTPTMP/file.out > /dev/null 2>&1 + grep -q "Bourne-Again shell script" $LTPTMP/file.out if [ $? -eq 0 ] then $LTPBIN/tst_resm TPASS "file: Recognised bash shell script correctly" @@ -234,7 +234,7 @@ file $LTPTMP/ksh_script.sh > $LTPTMP/file.out 2>&1 if [ $? -eq 0 ] then - grep "Korn shell script" $LTPTMP/file.out 2>&1 1>/dev/null + grep -q "Korn shell script" $LTPTMP/file.out if [ $? -eq 0 ] then $LTPBIN/tst_resm TPASS "file: recognised korn shell script" @@ -270,7 +270,7 @@ file $LTPTMP/C_script.sh > $LTPTMP/file.out 2>&1 if [ $? -eq 0 ] then - grep "C shell script" $LTPTMP/file.out > /dev/null 2>&1 + grep -q "C shell script" $LTPTMP/file.out if [ $? -eq 0 ] then $LTPBIN/tst_resm TPASS "file: Recognised C shell script correctly" @@ -308,13 +308,13 @@ file $LTPTMP/cprog.c > $LTPTMP/file.out 2>&1 if [ $? -eq 0 ] then - grep "ASCII C program text" $LTPTMP/file.out > /dev/null 2>&1 + grep -q "ASCII C program text" $LTPTMP/file.out if [ $? -eq 0 ] then $LTPBIN/tst_resm TPASS "file: Recognised C program text correctly" rm -f $LTPTMP/cprog.c else - grep "C source, ASCII text" $LTPTMP/file.out > /dev/null 2>&1 + grep -q "C source, ASCII text" $LTPTMP/file.out if [ $? -eq 0 ] then $LTPBIN/tst_resm TPASS "file: Recognised C program text correctly" @@ -366,7 +366,7 @@ file $LTPTMP/cprog > $LTPTMP/file.out 2>&1 if [ $? -eq 0 ] then - grep "ELF .*-bit $TEST_ARCH executable, .*" $LTPTMP/file.out > /dev/null 2>&1 + grep -q "ELF .*-bit $TEST_ARCH executable, .*" $LTPTMP/file.out if [ $? -eq 0 ] then $LTPBIN/tst_resm TPASS "file: Recognized ELF binary executable" @@ -408,7 +408,7 @@ file $LTPTMP/files.tar > $LTPTMP/file.out 2>&1 if [ $? -eq 0 ] then - grep "tar archive" $LTPTMP/file.out > /dev/null 2>&1 + grep -q "tar archive" $LTPTMP/file.out if [ $? -eq 0 ] then $LTPBIN/tst_resm TPASS "file: Recognised tar files" @@ -562,7 +562,7 @@ file $bDIR/SRPMS/cprog-0.0.7-3.src.rpm > $LTPTMP/file.out 2>&1 if [ $? -eq 0 ] then - grep -E "RPM v3(\.0)? src" $LTPTMP/file.out > /dev/null 2>&1 + grep -qE "RPM v3(\.0)? src" $LTPTMP/file.out if [ $? -eq 0 ] then $LTPBIN/tst_resm TPASS "file: Recognised RPM file correctly" |