RE: BASH and YES or ECHO cannot send "!"

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

 



-----Original Message-----
From: fedora-list-bounces@xxxxxxxxxx [mailto:fedora-list-bounces@xxxxxxxxxx] On Behalf Of Mike McCarty
Sent: Tuesday, December 13, 2005 11:40 AM
To: For users of Fedora Core releases
Subject: BASH and YES or ECHO cannot send "!"

I have come across an interaction between bash and yes or echo.

$ echo "Hello there!"
bash: !": event not found
$ echo "Hello there\!"
Hello there\!

So there seems not to be a way to display that string.

Oh, wait, apostrophes work!

$ echo 'Hello there!'
Hello there!

Interesting...
<end quote>

! Is a reserved symbol in bash, and it uses it for so many different things that it's not surprising that it would be difficult to get a real one past the parser. Note that \! is reserved as well. Since things quoted in double quotes get pushed back through the parser, the easiest way to get around that would be to use single quotes (which you pointed out will work).


-- 
Robert P. Nix		Mayo Foundation
RO-OC-1-13 (new loc)	200 First Street SW
507-284-0844		Rochester, MN 55905
-----
"In theory, theory and practice are the same, but
 in practice, theory and practice are different."


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux