sunmingtao / sample-code

3 stars 4 forks source link

"echo !<number>" throws error: -bash: !0: event not found (how to escapte exclamation mark in a command) #216

Closed sunmingtao closed 3 years ago

sunmingtao commented 3 years ago
\ =>echo !0
-bash: !0: event not found
sunmingtao commented 3 years ago

By default ! runs a history command. To disable it, use set +H. To enable it again, use set -H

\ =>set +H
\ =>echo !0
!0
\ =>set -H