lkml.org 
[lkml]   [2020]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] selftests/ftrace: Use printf for backslash included command
On Mon, 11 May 2020 14:59:20 +0000
David Laight <David.Laight@ACULAB.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

\
 
 \ /
  Last update: 2020-05-11 22:29    [W:0.069 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site