2 ms·
I agree that is ambiguous. If I were writing such a script where I wanted to launch a background process, and then create/truncate a file, I myself would separ
by chasil 4y ago
I agree that is ambiguous.
If I were writing such a script where I wanted to launch a background process, and then create/truncate a file, I myself would separate them:
date &
>FILE
Bash wouldn't mistake that, but a lot of shell scripts look like line noise and there are situations where bad form is required (quoted in an ssh, for example).
Obviously, people wanting the bash functionality in POSIX would:
date > file 2>&1
Bash discourages the latter form in my man page, but anyone interested in portability knows how profoundly bad that advice is.