I have been trying to find an example of bash usage where a preexisiting variable can be referenced within a $() command. I need to do this to assign a new variable to the output of the $() style command. I am not entirely sure how to search for what I am trying to achieve either. I am trying to use a variable 'vid' within a curl request. I'd love some help on this. Thanks! Here is an example of the bash:
vid= $(curl -X POST -H "Content-Type: application/json" -d @create_contact.json https://api.hubapi.com/contacts/v1/contact/?hapikey=$HUBSPOT_API_KEY | jq '.vid')
checkVid= $(curl -s https://api.hubapi.com/contacts/v1/contact/vid/"$vid"/profile?hapikey=$HUBSPOT_API_KEY | jq '.vid')