Results tagged “bash” from kwc blog

bash complaint of the day


$ echo "!str foo"
bash: !str: event not found
$ echo "\!str foo"
\!str foo

i.e. bash requires you to escape exclamation points in double-quoted strings, but if you escape them, it doesn't unescape them for you. How long has bash been around?

(the solution is to use single-quoted strings)