On 4/21/14, 12:10 AM, Maxdamantus wrote: > version: 4.3.11(5) > > This seems like a bug, but it seems to have been here for a few years > (from the git repository, bash-3.0 displays this behaviour while > bash-2.05b doesn't).
The history expansion code knows nothing about shell syntax, and barely understands quoting. It knows about backslashes, double quotes, and single quotes, and knows that single quotes don't have any special meaning inside double quotes. It's performed immediately after the shell reads a line, and it happens over the entire line. With those conditions, you should be able to figure out the behavior of the expansion FSM. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/