3

I have a curl command as follows which can contain a password. The password can contain special characters. !£$%^&#-~@ etc.

curl d "valuea=1234&password=1234@!&valuec=87979&submit=Set" -XPOST "http://$ipa/school.cgi"

When this is run I get: bash: !: event not found

How do I escape the special characters in the URL string ?

Thanks

Tom
  • 1,436
  • 24
  • 50
  • 4
    See https://stackoverflow.com/questions/6697753/difference-between-single-and-double-quotes-in-bash – IMSoP Feb 02 '18 at 10:13
  • Thanks that makes sense to use the single quotes. But how do I have use a variable in the URL ? eg: `curl d 'valuea=1234&password=$password&valuec=87979&submit=Set'` ? – Tom Feb 02 '18 at 12:13

0 Answers0