bug-bash
[Top][All Lists]
Advanced

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

Re: Syntax Question...


From: Chet Ramey
Subject: Re: Syntax Question...
Date: Thu, 18 Aug 2011 14:42:03 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0

On 8/18/11 12:14 PM, Greg Wooledge wrote:
> On Thu, Aug 18, 2011 at 10:55:11AM -0400, Chet Ramey wrote:
>> The quoted paragraph applies to all redirection operators (and parameter
>> and variable expansion are still identical).  The description of <<<
>> notes that it does not perform pathname expansion at all.
> 
>       The word following the redirection operator in the following
>       descriptions, unless otherwise noted, is subjected to brace expansion,
>       tilde expansion, parameter expansion, command substitution, arithmetic
>       expansion, quote removal, pathname expansion, and word splitting.  If
>       it expands to more than one word, bash reports an error.
> 
>       ...
> 
>     Here Strings
>       A variant of here documents, the format is:
> 
>            <<<word
> 
>       The word is expanded and supplied to the command on its standard
>       input.
> 
> I guess the "variant of here documents" part is meant to imply that all
> of the exceptions from that section apply here as well.

Close, but not quite.  The word in a here string is expanded similarly
to the body of a here document, as you said, but without the special
cases.  It's more straightforward.

The expansions are the default set as described in the quoted paragraph,
without pathname expansion and, since the result is passed to the command
as a single string, word splitting.

I think the confusion arises over the precise meaning of the word `above'.

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



reply via email to

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