[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"Ca


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"Ca