bug-bash
[Top][All Lists]
Advanced

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

Re: `&>' doesn't behave as expected in POSIX mode


From: Eli Schwartz
Subject: Re: `&>' doesn't behave as expected in POSIX mode
Date: Sun, 20 Jun 2021 10:18:59 -0400

On 6/20/21 6:30 AM, Chris Elvidge wrote:
> On 20/06/2021 09:05 am, Oğuz wrote:
>>      $ set -o posix
>>      $ uname &>/dev/null
>>      $
>>
>> `uname &' and `>/dev/null' should be parsed as two separate commands;
>> that, if I'm not missing anything, is what POSIX says. But bash
>> doesn't do that in POSIX mode, and redirects both stderr and stdout to
>> `/dev/null'.
>>
>>
>> Oğuz
>>
>>
> 
> If you want to parse them as two separate commands, separate them.

*Neither* behavior is similar to e.g. dash's behavior, or for that
matter ksh. Both print the uname output after registering it as a
backgrounded job (redirection does not get applied to the command itself).

At any rate... are you suggesting the POSIX rules require a space here
in order to distinguish the behavior?

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]