On 07/23/2011 02:17 PM, Joachim Schmitz wrote:
Jan Schampera wrote:
On 22.07.2011 18:12, the mad doctor kaeding wrote:
is this a bug?
echo goodbye\ cruel\ world\!
goodbye cruel world!
echo "goodbye cruel world!"
bash: !": event not found
echo "goodbye cruel world\!"
goodbye cruel world\!
No, this is a specific history expansion in interactive shells.
Execute ''set +H'' and try again (it's disabled in non-interactive
shells).
Or use single quotes:
echo 'goodbye cruel world!'
double quotes only prevent filename expansion, but allow
interpretation of other Shell meta-characters
Not true. Double qutes remove special meaning of characters except `$',
`\', and, when history expansion is enabled, `!'. Meta characters
loses its special meaning.
Note: `!' is usual history expansion character, but can be a different
character.
RR
Bye, Jojo