Re: Arithmetic expansion in rediretion word is evaluated twice

2020-06-02 Thread Chet Ramey
On 6/2/20 1:18 AM, Oğuz wrote: > Below is the error message from the compilation failure after git pull && > make: You have to run configure again to remake the Makefiles. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Ch

Re: Seg fault on "echo ~nosuchuser"

2020-06-02 Thread Chet Ramey
On 6/1/20 7:58 PM, Ángel wrote: > On 2020-06-01 at 15:12 -0400, Chet Ramey wrote: >> I finally found a case where 16-byte alignment for memory returned by >> malloc() is required. But it's only on Linux systems that use systemd. >> I bet it's trying to marshal arguments for IPC and uses instruction

Re: Arithmetic expansion in rediretion word is evaluated twice

2020-06-02 Thread Chet Ramey
On 6/1/20 3:34 PM, Oğuz wrote: > See: > > $ unset foo > $ : <$((foo+=42)) > bash: 84: No such file or directory > $ echo $foo > 84 Yes. The redirection is evaluated once for the open and again for the error message. -- ``The lyf so short, the craft so long to lerne.'' - Chau

Re: Arithmetic expansion in rediretion word is evaluated twice

2020-06-02 Thread Dale R. Worley
Chet Ramey writes: > On 6/1/20 3:34 PM, Oguz wrote: >> See: >> >> $ unset foo >> $ : <$((foo+=42)) >> bash: 84: No such file or directory >> $ echo $foo >> 84 > > Yes. The redirection is evaluated once for the open and again for the > error message. That does seem rather a bu

Re: local failure

2020-06-02 Thread Dale R. Worley
Laurent Picquet writes: > Should the 'local' command be the one able to detect that the assignment to > the variable had an non-zero exit code and return the non-zero exit code? John Passaro writes: > I think the underlying question here is not exactly "how do I gather this > from the docs" as m

Command substitution

2020-06-02 Thread Dale R. Worley
Naively, I expect that FOO="$( command2 )" command1 $FOO has the same effect as command1 $( command2 ) and FOO="$( command2 )" command1 "$FOO" has the same effect as command1 "$( command2 )" Has anyone pushed the boundaries of this and can tell me whether there are g

Re: Command substitution

2020-06-02 Thread Eli Schwartz
On 6/2/20 9:44 PM, Dale R. Worley wrote: > Naively, I expect that > > FOO="$( command2 )" > command1 $FOO > > has the same effect as > > command1 $( command2 ) > > and > > FOO="$( command2 )" > command1 "$FOO" > > has the same effect as > > command1 "$( command2 )" >

Re: Command substitution

2020-06-02 Thread felix
Quoting is useless when assigning variable from ouptut of command or another variable: $ foo=1 2 3 4 bash: 2: command not found Ok. But $ foo=$(seq 1 3) $ declare -p foo declare -- foo="1 2 3" $ foo="$(seq 1 3)" $ declare -p foo declare -- foo="1 2