[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Quoted new-lines cause heredoc to consume first new-line
From: |
Chet Ramey |
Subject: |
Re: Quoted new-lines cause heredoc to consume first new-line |
Date: |
Mon, 6 Dec 2021 10:01:30 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 |
On 12/5/21 5:15 PM, S0AndS0 wrote:
> ## How to reproduce
>
>
> Copy following example into a terminal session;
>
>
> ```bash
> gawk '{
> print $0;
> }' <<'EOF'
> first
> second
> third
> EOF
> ```
>
>
> Press `<Enter>`, then `<Arrow-Up>`
>> [user@host ~]$ gawk '{
>> print $0;
>> }' <<'EOF'first
>> second
>> third
>> EOF
>
>
> Notice the `}' <<'EOF'first` bit where the first new line is consumed.
Thanks for the report.
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://tiswww.cwru.edu/~chet/