Linux Test Project
 help / color / mirror / Atom feed
From: Yixin Zhang <yixin.zhang@intel.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH ltp 2/6] io/stress_floppy/stress_floppy: Fix shellcheck issue SC2069
Date: Fri, 20 Apr 2018 11:18:51 +0800	[thread overview]
Message-ID: <20180420031855.22657-2-yixin.zhang@intel.com> (raw)
In-Reply-To: <20180420031855.22657-1-yixin.zhang@intel.com>

error: The order of the 2>&1 and the redirect matters. The 2>&1 has to
be last. [SC2069]

Signed-off-by: Yixin Zhang <yixin.zhang@intel.com>
---
 testcases/kernel/io/stress_floppy/stress_floppy | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/io/stress_floppy/stress_floppy b/testcases/kernel/io/stress_floppy/stress_floppy
index b269f5ffe..ff327dffb 100755
--- a/testcases/kernel/io/stress_floppy/stress_floppy
+++ b/testcases/kernel/io/stress_floppy/stress_floppy
@@ -96,7 +96,7 @@ test_tar()
 		else
 			tst_resm TINFO "$the_file Tar read passed."
 		fi
-		diff $TCdat/dumpdir/$the_file $the_file 2>&1 >/dev/null
+		diff $TCdat/dumpdir/$the_file $the_file >/dev/null 2>&1
 		if [ $? -ne 0 ]; then
 			tst_resm TFAIL "Diff of the $the_file tar files failed!"
 			return
@@ -140,7 +140,7 @@ test_dump()
 
 	for the_file in 1K_file 10K_file 100K_file
 	do
-		diff dumpdir/$the_file /$TCdat/dumpdir/$the_file 2>&1 >/dev/null
+		diff dumpdir/$the_file /$TCdat/dumpdir/$the_file >/dev/null 2>&1
 		if [ $? -ne 0 ]; then
 			tst_resm TFAIL \
 				 "Diff of the $the_file backup files failed!"
@@ -180,7 +180,7 @@ test_cpio()
 		else
 			tst_resm TINFO "$the_file cpio read passed."
 		fi
-		diff $TCdat/dumpdir/$the_file $the_file 2>&1 >/dev/null
+		diff $TCdat/dumpdir/$the_file $the_file >/dev/null 2>&1
 		if [ $? -ne 0 ]; then
 			tst_resm TFAIL \
 				 "Diff of the $the_file cpio files failed!"
@@ -213,7 +213,7 @@ test_dd()
 		else
 			tst_resm TINFO "$the_file dd read passed."
 		fi
-		diff $TCdat/$the_file $the_file 2>&1 >/dev/null
+		diff $TCdat/$the_file $the_file >/dev/null 2>&1
 		if [ $? -ne 0 ]; then
 			tst_resm TFAIL "Diff of the $the_file dd files failed!"
 			return
-- 
2.14.1


  reply	other threads:[~2018-04-20  3:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20  3:18 [LTP] [PATCH ltp 1/6] fs/acls/acl_test01: Fix shellcheck issue SC2069 Yixin Zhang
2018-04-20  3:18 ` Yixin Zhang [this message]
2018-04-20  3:18 ` [LTP] [PATCH ltp 3/6] numa/numa01.sh: " Yixin Zhang
2018-04-20  3:18 ` [LTP] [PATCH ltp 4/6] network/nfs/fsx-linux/fsx.sh: " Yixin Zhang
2018-04-20  3:18 ` [LTP] [PATCH ltp 5/6] network/tcp_cmds/host/host01: " Yixin Zhang
2018-04-20  3:18 ` [LTP] [PATCH ltp 6/6] network/tcp_cmds/rcp/rcp01: Fix shellcheck issue SC2157/SC2069 Yixin Zhang
2018-04-20  8:26 ` [LTP] [PATCH ltp 1/6] fs/acls/acl_test01: Fix shellcheck issue SC2069 Petr Vorel
2018-04-20  8:28   ` Cyril Hrubis
2018-04-20  9:08 ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180420031855.22657-2-yixin.zhang@intel.com \
    --to=yixin.zhang@intel.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox