I am trying to use a Shell Variable inside a shell script , My shell script is as below
HerculesResponse=$(curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{ "testID": "591dc3cc4d5c8100054cc30b", "testName": "stagetest", "poolID": "5818baa1e4b0c84637ce36b4", "poolName": "Default", "dashboardID": "582e3a2ff5c650000124c18a", "dashboardName": "Default", "dateCreated": "2017-05-23T13:51:23.558Z", "callbackHeader": {}, "active": true }' "https://example.com:8080/run")
reportURL=$(expr "$HerculesResponse" : '.*"reportURL":"\([^"]*\)"')
echo $reportURL
runId=$(echo $reportURL | cut -d"=" -f 2)
echo $runId
How do I use runId variable outside of this shell script to run the command
testStatus=$(curl -X GET https://example.com:8080/runs/$runId)
I tried to use export runId command but doesn't work