I am working on simple curl POST script and I have problem with string interpolation of a variable that is initialized with data from a script. Let me describe it:
#!/bin/bash
EMAIL=$(source ./random_email_generator.sh) #this generates some random string
echo "$EMAIL" #here email is printed well
curl --insecure --header "Content-Type: application/json" \
--request POST \
--data '{"email":'"$EMAIL"',"password":"validPassword"}' \ #problem lies here because email is always empty string
http:/ticketing.dev/api/users/signup
To sum up, there is a lot of quotes and double quotes here and it is abit mixed up, how can I resolve value of EMAIL in place of json body?
Thanks in advance