[EMAIL PROTECTED] wrote: > When trying to produce an exclamation mark (!) inside a quoted > string is behaving differently from expected. I cannot see a > way of producing an exclamation mark inside a doubly-quoted > (") string in the bash prompt.
You are correct. However that is inherited functionality of the history mechanism as it came from csh. Please see this message that addresses exactly the same question. http://lists.gnu.org/archive/html/bug-bash/2007-10/msg00075.html As a side note if the ! is followed immediately by a space, tab, newline, carriage return or = then it can be embedded in a string. $ echo "foo! With a space following" foo! With a space following If you never use history expansion then turning it off may be acceptable. $ set +o histexpand $ set -o | grep histexpand histexpand off $ echo "!" ! Bob