I'm trying to assign the output of awk to variable. I tried with solutions specified here but nothing seems to work. I'm first doing curl and then parsing the result from there
#!/bin/sh
KEY="title"
curl https://jsonplaceholder.typicode.com/todos/1 | statu=$(awk -F'[,:}]'
'{for(i=1;i<=NF;i++){if($i~/'$KEY'\042/){print $(i+1)}}}' | tr -d '"')
echo "This is status" "$statu"