Echoing "!" inside a string does some weird things
7
votes
2
answers
1119
views
If I type in this:
echo "Hello, World!"
I don't know the name of it, but it prompts me for the next line. You know the PS2
thing. Or if you type echo \
and press Enter
.
Why?
Well I know that !
is a **Special Variable** that you can use to reference your history.
But as soon as I use this:
echo "Hello, World"!
I get my desired output. What is happening and why can't you use !
inside ""
?
---
Thanks for your help :)
Asked by Bog
(1134 rep)
May 12, 2023, 02:14 PM
Last activity: May 16, 2023, 09:24 AM
Last activity: May 16, 2023, 09:24 AM