[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash shouldn't perform syntax check on single-quoted strings
From: |
Chet Ramey |
Subject: |
Re: Bash shouldn't perform syntax check on single-quoted strings |
Date: |
Fri, 5 Feb 2021 09:45:59 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 2/5/21 5:15 AM, Oğuz wrote:
$ echo '
> ${a+$(|)}
bash: command substitution: line 7: syntax error near unexpected token `|'
bash: command substitution: line 7: `|)}'
bash: unexpected EOF while looking for matching `)'
>
Reproducible on devel, 5.1.4, and 5.0.17, but the latter handles it better.
Thanks for the report. It's not the parser, or a real `syntax check'; it's
the history code trying to determine which delimiter to use when adding it
to the history list.
And while testing this on devel, I came across another one:
$ echo $BASH_VERSIbash: xmalloc: stringvec.c:40: cannot allocate
15227146888 bytes (2510848 bytes allocated)
$
$ echo $BASH_VERSIOSegmentation fault (core dumped)
$
I hit tab a few times to get the segfault.
I can't reproduce this.
--
``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/