Re: greater-than + number sign = newlines in history
From:
Chet Ramey
Subject:
Re: greater-than + number sign = newlines in history
Date:
Mon, 4 May 2020 08:58:08 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.7.0
On 5/3/20 2:28 AM, Tobias Wendorff wrote:
> Bash Version: 5.0
> Patch Level: 3
> Release Status: release
>
> Description:
> When creating a here document containing the greater-than sign followed
> by number sign, newlines get added to Bash history:
> ```
> $ history
> 1 cat << 'EOF' > /dev/null
> <#a
>
> <#b
>
> EOF> ```
Thanks for the report. It's not the less-than sign; it's the hash character
that makes the difference. The command-oriented history mode has to pay
attention to those, because shell comments are one place where you can't
replace a newline with a semicolon. It just needs to also pay attention to
the fact that bash is reading a here-document.
This was reported and fixed in October, 2019, and the fix is in the devel
branch.
--
``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/