[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200511162842.7c198741@gandalf.local.home>
Date: Mon, 11 May 2020 16:28:42 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: David Laight <David.Laight@...LAB.COM>
Cc: 'Masami Hiramatsu' <mhiramat@...nel.org>,
Shuah Khan <shuah@...nel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Tom Zanussi <tom.zanussi@...ux.intel.com>,
Li Philip <philip.li@...el.com>,
Liu Yiding <yidingx.liu@...el.com>,
Xiao Yang <yangx.jy@...fujitsu.com>,
Andreas Schwab <schwab@...ux-m68k.org>
Subject: Re: [PATCH v2] selftests/ftrace: Use printf for backslash included
command
On Mon, 11 May 2020 14:59:20 +0000
David Laight <David.Laight@...LAB.COM> wrote:
> > > echo "Test command: $command"
> > > echo > error_log
> > > - (! echo "$command" >> "$3" ) 2> /dev/null
> > > + (! printf "%s" "$command" >> "$3" ) 2> /dev/null
>
> WTF is the (! for ??
> The (...) is a subshell.
> And ! inverts the exit status.
> Neither is needed at all.
This is done because the scripts are run with '-e' and will exit the script
on any error.
This particular test is examining errors in the error log. The command
being written into $3 is going to fail, and return an exit code. The
"(! ..)" is needed, otherwise that failure will exit out the script.
-- Steve
Powered by blists - more mailing lists