Chet Ramey wrote: >> Chet Ramey wrote: >> >>> Yes, this is where the semantics of history expansion clash with traditional >>> shell behavior. Only single quotes inhibit history expansion. >> >> In that case, situation number 3 is producing the wrong result, since there >> are no single quotes there, only a backslash. > > OK, you got me. Unquoted backslashes inhibit history expansion also.
But how come the backslash in double-quotes is both 1) inhibiting history expansion, and 2) causing a backslash to be printed? If it was being treated purely as a literal backslash, I would expect the same output as case 1 in my bug report. If it was meant to be inhibiting history expansion, I would not expect to see it printed as well. Either do one or the other, not both. Do you begin to see the inconsistency here?