RE: [PATCH v2] selftests/ftrace: Use printf for backslash included command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > +    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)




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux