bug-bash
[Top][All Lists]
Advanced

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

Re: Pathname expansion not performed in Here Documents


From: Chet Ramey
Subject: Re: Pathname expansion not performed in Here Documents
Date: Mon, 27 Feb 2012 12:07:24 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 2/27/12 8:07 AM, Davide Baldini wrote:

>> "If word is unquoted, all lines of the here-document are subjected to 
>> parameter expansion, command substitution, and arithmetic expansion."
>>
>> No pathname expansion.
> 
> That section of manual doesn't specifically include word splitting nor
> pathname expansion into the list of performed expansions, but the word
> splitting does include itself unconditionally:

That's a pretty literal reading of the document.  If you want to be just
as literal, the cited sections only mention expansions in the context of
being "performed on the command line after it has been split into words."
Not here-documents at all.  Ridiculous, you say?  No more so than not
believing what the text says.

> 
>>      Word Splitting
>> The  shell  scans the results of parameter expansion, command substitu-
>> tion, and arithmetic expansion that did not occur within double  quotes
>> for word splitting.
> 
> and pathname expansion ties itself to word splitting:
> 
>>      Pathname Expansion
>> After  word  splitting, [...]
> 
> If intended behaviour is to exclude some expansions from performing word
> splitting or pathname expansion, they should be specifically pointed out
> in the manual, like the assignment operator section does:

So what you would like, basically, is that all cases where expansions
take place list both the expansions performed and the ones not
performed?  Shouldn't the former be sufficient?

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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