'How to pass bearer token in curl script?

here is a simple curl command. however, i keep getting an error : while attempting to read the output file

command:

token1=$(jq .token token.json)

echo 'token =' ${token1}

curl -k \
        -H "Authorization: Bearer ${token1}" \
        -X GET \
        "some://random/url" \
> twistcli; chmod a+x twistcli;

result

cat ./twistcli

{"err":""}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source