Re: [Help-bash] Errorneously flagged undefined variable with here string
From:
Chet Ramey
Subject:
Re: [Help-bash] Errorneously flagged undefined variable with here string redirected to bash-allocated file descriptor when followed by a command?
Date:
Mon, 10 Dec 2018 10:00:09 -0500
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.3.3
On 12/9/18 6:06 AM, address@hidden wrote:
> Hello,
>
> I've encountered an error where bash says that a variable is undefined when
> I'm accessing it, even though to my understanding it's supposed to be
> defined at that point. I'm asking if I'm misunderstanding something, or
> should this be treated as a bug.
It's not a bug; variable expansion happens before redirections are performed.
The sequence is in
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://tiswww.cwru.edu/~chet/
Re: [Help-bash] Errorneously flagged undefined variable with here string redirected to bash-allocated file descriptor when followed by a command?,
Chet Ramey<=