[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Escaping the history expansion character

From: Matthew Walker
Subject: Re: Escaping the history expansion character
Date: Mon, 09 Aug 2004 14:00:51 +1200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

Matthew Walker wrote:
 From the bash info page:
  Only `\' and `'' may be used to escape the history expansion

I have tried the following:
  echo '!'   # works fine, displays "!"
  echo "!"   # errors as expected with "event not found"
  echo "\!"  # produces "\!" --- this is my problem

Why is it that "\!" doesn't output just "!"?

For every other scenario "\x" produces "x". Why does this fail for an exclamation mark?

This time I remembered to check the FAQ, so hopefully this isn't a stupid question :o)


I should have also said that "bash --version" gives me "GNU bash, version 3.00.0(1)-release (i686-pc-linux-gnu)" and that I'd like to know how to work around this problem---how do I get an exclamation mark within double quotes?

I upgraded to bash version 3 in the hope that this issue might have been resolved. Originally I was working with 2.04(b).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]