Re: Arithmetic expansion in rediretion word is evaluated twice

2020-06-03 Thread Chet Ramey
On 6/2/20 9:14 PM, Dale R. Worley wrote: > 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

Re: Command substitution

2020-06-03 Thread Greg Wooledge
On Tue, Jun 02, 2020 at 09:44:45PM -0400, Dale R. Worley wrote: > Naively, I expect that > 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 gotchas? The mai

Re: Command substitution

2020-06-03 Thread Lawrence Velázquez
> On Jun 3, 2020, at 3:18 AM, Martin Schulte > wrote: > >> Unfortunely, I don't retrieve this behaviour in man page. > > Me neither, maybe the manual should read > > If the substitution appears within double quotes *or as the right-hand > side of an variable assignment*, word splitting and file

Re: Command substitution

2020-06-03 Thread Martin Schulte
Hello Felix! > Quoting is useless when assigning variable from ouptut of command or > another variable: Yes, I assume you are right. > Unfortunely, I don't retrieve this behaviour in man page. Me neither, maybe the manual should read If the substitution appears within double quotes *or as the