'Cannot index string with string "auth"

I am running the below command from ksh prompt.

export client_token=$(echo $client_token_response | jq  -r '.auth.client_token') 

It is giving me the below error .

jq: error (at <stdin>:1): Cannot index string with string "auth"

The same command is working fine in bash prompt.

Could you please let me know what I am doing wrong here.



Sources

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

Source: Stack Overflow

Solution Source