When making query using Jq Play for the provided json the output looks as expected Demo. But when I try the same query in shell Script & iterate the object I see new row got added because of whitespace between sentence.
Query:
query=$(cat $basename/test.json | jq -r '.DesignCode | to_entries[] | "\(.key):\(.value)"')
for i in $query
do
printf "$i"
done
used in the shell script
Output ScreenShot
What is the correct way to write the query?