Subject: bug#8000: 23.2; strange behavior of !$ in shell window

From: Glenn Morris <[email-masked]>
Date: Mon, 07 Feb 2011 23:24:16 -0500

Please use a valid email address to report bugs. I cannot reply to your
address, so I hope you will read this.

relson@osage wrote:

> In a shell (bash) window, if I type "echo x<enter>", the character "x"
> is echoed (as expected).
>
> If I then type "ls -l !!<tab>" the complete previous command is added
> to the current line andwhat is executed is "ls -l echo x". What
> _should_ have been execute is "ls -l x"

Why is that what should have been executed? I thought `!!' was a tcsh
feature (making it kind of strange that it works in a bash shell at all
IMO...) that expands to the previous command, not the stdout of the
previous command. I'm not aware of any shell history expansion that
works in terms of the output of old commands. This would make no sense
in the majority of cases (eg cp etc).