The awk manual lists this as one of the first examples:
awk "BEGIN { print \"Don't Panic!\" }"
Apparently I should see “Don’t Panic!”, but actually I see:
-bash: !\": event not found
Any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It all depends on your shell.
Exclamation points are used by modern shells to refer to parts of your command line history. In
bashandtcsh, they can be interpreted as a history reference. You can escape the!with a\, or you can leave it out, or you can use a simple shell.In my
bashexample above, you see thie failed history substitution. In mytcshexample, you see a problem with quoting (since double quotes can’t be escaped this way). The awk manual you’re using is presumably old enough that it doesn’t assume everyone runs bash.