#bash (2020-08)
A channel for bash scripting
2020-08-07
![Brij S avatar](https://secure.gravatar.com/avatar/ae6bd7c5812b96db0ac75fa625906db6.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0021-72.png)
Brij S
Hey bash experts!
workspace_id=$(curl -s --header "Authorization: Bearer ${TFE_TOKEN}" --header "Content-Type: application/vnd.api+json" "<https://some/giant/url/here>" | jq -r .data.id)
echo "Workspace ID is ${workspace_id}"
when I run that curl command in shell, it works fine but when I put that into a shell script it just returns null, any ideas why?
![bradym avatar](https://avatars.slack-edge.com/2023-06-21/5464816405572_dd21bed1bf537acb6539_72.jpg)
bradym
Most likely is that TFE_TOKEN
is not correctly set in the script
I’d do two things to troubleshoot:
set -x
before the workspace_id
line, and change your curl command to curl -sS
so you’ll get any errors from curl that are currently being suppresed.
![Brij S avatar](https://secure.gravatar.com/avatar/ae6bd7c5812b96db0ac75fa625906db6.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0021-72.png)
Brij S
that was it! the token wasnt set
![Brij S avatar](https://secure.gravatar.com/avatar/ae6bd7c5812b96db0ac75fa625906db6.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0021-72.png)
![bradym avatar](https://avatars.slack-edge.com/2023-06-21/5464816405572_dd21bed1bf537acb6539_72.jpg)