shell parsing bug with &>
Harald Becker
ralda at gmx.de
Fri Sep 7 04:50:48 UTC 2012
Hi Rich !
On 07-09-2012 00:13 Rich Felker <dalias at aerifal.cx> wrote:
>">file" is valid by itself as a command; it truncates file to 0 bytes,
>creating it if it does not exist. It's even more useful with noclobber
>mode, e.g.
>
>set -C;bg_command&>lockfile||exit 1
I don't want to jump into the discussion (due to lack of time), so just
some question to satisfy my interesst:
What magic thing are you trying to do here?
set -C;>lockfile||exit 1
looks ok ... create lockfile or abort if not possible
... why throwing in that background command at this place?
... why not generally adding a space after &? It's so easy to fix the
script with a single sed call, if it does not contain tons of ugly
constructs (like strings containing "&>").
Sorry if it sound provocative, I'm just interested/wondering what/why
are you doing here. Nothing more.
--
Harald
More information about the busybox
mailing list