bug-bash
[Top][All Lists]
Advanced

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

Re: Here strings and brace expansion not working as per man page


From: Chet Ramey
Subject: Re: Here strings and brace expansion not working as per man page
Date: Thu, 9 Feb 2017 15:55:02 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

On 2/8/17 3:04 PM, Conor McCarthy wrote:

> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
> 
> Description:
>         Here strings are documented as:
> 
>            [n]<<<word
> 
>         The word undergoes brace  expansion,  tilde  expansion,  parameter  
> and
>         variable  expansion,  command  substitution,  arithmetic expansion, 
> and
>         quote removal.
> 
>         But brace expansion is not applied:
> 
>         $ read zz <<< {1..9}
>         $ echo $zz
>         {1..9}
> 
>         The codepath from write_here_string() does not pass through any
>         expand_xxx functions which apply brace expansion, AFAICT.
> 
>         (bash was built with -fno-inline for gdb only)
> 
> Repeat-By:
>         $ read zz <<< {1..9}
>         $ echo $zz
>         {1..9}
> 
>         Expected behaviour would be similar to:
>         $ read zz <<< $(echo {1..9})
>         $ echo $zz
>         1 2 3 4 5 6 7 8 9

Thanks for the report.  This is a documentation error.  Your workaround
is a reasonable one.

Chet

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



reply via email to

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