[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f61eda03333941958d62f9df93ba534b@AcuMS.aculab.com>
Date: Mon, 11 May 2020 14:59:20 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Masami Hiramatsu' <mhiramat@...nel.org>
CC: Shuah Khan <shuah@...nel.org>,
Steven Rostedt <rostedt@...dmis.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
> > + pos=$(printf "%s" "${2%^*}" | wc -c) # error position
> > + command=$(printf "%s" "$2" | tr -d ^)
You may want to put all the $(...) inside "" to avoid field splitting
(not relevant to a shell assignment with modern shells) and
filename globbing.
> > 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.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists