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: Davide Baldini
Subject: Re: Pathname expansion not performed in Here Documents
Date: Mon, 27 Feb 2012 14:07:25 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20111110 Icedove/3.0.11

On 02/27/12 07:26, Pierre Gaston wrote:
> The manual seems quite clear:
> "If word is unquoted, all lines of the here-document are subjected to
> parameter  expansion,  command  substitution,  and arithmetic
> expansion.  In the latter case, the character sequence \<newline> is
> ignored, and \ must be used  to  quote the characters \, $, and `."
> 
> Maybe you could point the part of  the manual that mislead you into
> thinking that  " here doc are supposed to expand with no special
> exceptions" so that it can be corrected?

I'm sending messages to this group using both the mailing lists and the
nntp, but unfortunately the two seem poorly connected so that my mails
don't get pushed from one end to the other in the span of 20 hours.

Pierre, I referred to specific sections of the manual in my previous
"lost" message, here pasted:

---------------------------------------------------------------------
FROM Davide Baldini


On 02/27/12 04:11, Dan Douglas 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:

>      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:

> A variable may be assigned to by a statement of the form
>  
>       name=[value]
>  
> [...] All values undergo tilde expansion, parameter and variable
> expansion, command substitution, arithmetic expansion, and quote
> removal (see  EXPANSION below). [...] Word splitting is not
> performed, with the exception of "$@" as explained below under
> Special Parameters. Pathname expansion is not performed.



reply via email to

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