[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Errorneously flagged undefined variable with here string
Re: [Help-bash] Errorneously flagged undefined variable with here string redirected to bash-allocated file descriptor when followed by a command?
Mon, 10 Dec 2018 10:00:09 -0500
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:
> 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
``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/