0

I am trying to capture a string in mac terminal zsh

when i try

echo "abc1234!"      

It would prompt for dquote>

I have tried adding a additional quote like this

echo "abc1234!""

Output

abc1234

how do i capture ! character in the string ??

nova_rubo
  • 49
  • 1
  • 7

1 Answers1

0

Either turn off history expansion with

setopt nobanghist

, or escape the !character:

echo "abc1234\!" 
user1934428
  • 19,864
  • 7
  • 42
  • 87