[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inconsistent handling of closing brace inside no-fork command substi
From: |
Chet Ramey |
Subject: |
Re: inconsistent handling of closing brace inside no-fork command substitution |
Date: |
Wed, 3 Jan 2024 14:59:44 -0500 |
User-agent: |
Mozilla Thunderbird |
On 1/3/24 8:41 AM, Oğuz wrote:
See:
$ ${ case } in }) echo uname; esac }
Linux
$ ${ case }x in }x) echo uname; esac }
bash: command substitution: line 25: syntax error near unexpected token `x'
bash: command substitution: line 25: ` }x)'
$ ${ case }x in \}x) echo uname; esac }
Linux
$
I don't think this should be a syntax error because the closing brace
is not in a place it can terminate the command substitution.
I agree. It looks like a problem with reconsituting the text of the command
substitution from the parse tree. I'll fix it for the next devel branch
push.
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/