I am trying to write a bash script to start a build on Jenkins. It works but the problem I am having is with passing parameter values. I have: curl -X POST $Server -d token='MyToken' --data-urlencode json='{ ... }' and I want to replace the json='{...}' with a variable as in json=$Params where my json string is '{"parameters": [{"name":"USER", "value":"Tim"}]}' This json string works when I specify it on the command line but not however when I put it in a variable. With the variable I get a stack trace and html - several screens worth. When assigning to a variable a have tried several things though currently I have Params="{\"parameters\": [{\"name\":\"USER\", \"value\":\"Tim\"}]}" It appears that it can't parse my json when I pass it through $Params but can in the other case. What I am trying to do is get the user name passed in from a perforce trigger, then get that users email address. I have that working assigning to a variable @UserEMail. I then want to pass that in the json value. I haven't gotten to the point of replacing "Tim" with the value from @UserEmail. Thank you for any help. |