On 7/1/20 8:48 AM, Clark Wang wrote: > See the following example (tested with bash 5.0.7): > > > # bind -q shell-expand-line > shell-expand-line can be invoked via "\e\C-e". > > # echo $PWD # press ESC C-e > # echo /root > > # echo $( pwd ) # press ESC C-e > # echo /root > > # echo $'foo' # press ESC C-e > # echo $foo > > > Is this a bug?
I suppose it is. $'...' isn't a word expansion, it's a form of quoting that gets translated and transformed into '...' by the parser. When the word expansion code sees $'...', unexpectedly, it just performs the usual quote removal. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/