Article 5EKEY [SOLVED] [BASH] curl - special characters in password

[SOLVED] [BASH] curl - special characters in password

by
czezz
from LinuxQuestions.org on (#5EKEY)
Hi,
I am trying to run following CURL (ultimately I want to run it in a bash script).
The problem is that the "password" contains special characters (and im guessing the most problematic ones are \ and "
Does anyone know is there any way to escape those characters?

Code:curl -k -s \
-H "Content-Type: application/json" \
-d '
{
"auth": {
"tenantName": "tenant1",
"passwordCredentials": {
"username": "admin1",
"password": "My\O?4Zpassword_&4$Xe,=|7is_Complicated"Ca"
}
}
}' \
"https://keystone-node.net:5000/v2.0/tokens?nocatalog"Note1:
I tried escaping as in following link but that didnt help:
https://en.wikipedia.org/wiki/Percent-encoding
Code:My%5C\O?4Zpassword_&4$Xe,=|7is_Complicated%22"Calatest?d=yIl2AUoC8zA latest?i=sqMQuNxHcpE:rcwqZNvOOGQ:F7zBnMy latest?i=sqMQuNxHcpE:rcwqZNvOOGQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=sqMQuNxHcpE:rcwqZNvOOGQ:gIN9vFwsqMQuNxHcpE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments