I have a json store in jsonFile
{
"key1": "aaaa bbbbb",
"key2": "cccc ddddd"
}
I have code in mycode.sh
:
#!/bin/bash
value=($(jq -r '.key1' jsonFile))
echo "$value"
After I run ./mycode.sh
the result is aaaa
but if I just run jq -r '.key1' jsonFile
the result is aaaa bbbbb
Could anyone help me?