0

I was running curl in my linux terminal:

curl -u ‘user’:’$3cur!’ -T udhaya.war ‘http://xx.xx.xx.xxx/manager/text/deploy?path=/udhaya

I get the following error:

bash: !’: event not found

TERMINATOR
  • 1,180
  • 1
  • 11
  • 24
vortext
  • 13
  • 1
  • 3
  • This is not a programming question (you just don't know bash interactive use) and as such off-topic here. You may try [unix.se] or [su], but make sure you a) read their rules and b) make sure you did **some** research before posting. – tink Sep 12 '20 at 17:55
  • Duplicate of https://stackoverflow.com/questions/11816122/echo-fails-event-not-found – tripleee Jan 28 '22 at 13:24

1 Answers1

1

issue is with the "!" mark in your ‘user’:’$3cur!’.

See following example :

[root@mymachine~]# echo "!"
-bash: !: event not found

We need to turnoff history expansion to avoid it using 'set +H' before running your curl command as shown below:

[root@mymachine ~]# set +H
[root@mymachine ~]# echo "!"
!
confused genius
  • 2,876
  • 2
  • 16
  • 29
  • Not only are you answering off-topic questions, your suggestion may work, but it's tipping out the baby with the bath water ... a simple replacement of `"` with `'` would have done. – tink Sep 12 '20 at 17:43