[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Incorrect alias expansion within command substitution
From: |
Martijn Dekker |
Subject: |
Incorrect alias expansion within command substitution |
Date: |
Tue, 1 Feb 2022 04:40:34 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 |
On the latest code from the devel branch:
GNU bash, versie 5.2.0(35)-alpha (x86_64-apple-darwin18.7.0)
Reproducer script:
shopt -s expand_aliases
alias let='let --'
set -x
let '1 == 1'
: $(let '1 == 1')
Output:
+ let -- '1 == 1'
++ let -- -- '1 == 1'
foo: line 5: let: --: syntax error: operand expected (error token is "-")
+ :
The alias is incorrectly expanded in the command substitution,
duplicating the '--' argument and causing a syntax error.
--
|| modernish -- harness the shell
|| https://github.com/modernish/modernish
||
|| KornShell lives!
|| https://github.com/ksh93/ksh
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Incorrect alias expansion within command substitution,
Martijn Dekker <=