i am making a req to the fly machine where i run a bash script like sh ./script1.sh
the script file returns data in json structure
if [ "$output" = "$expected_output" ]; then
# Output matches expected result
json_output="{ \"state\": \"pass\", \"output\": \"$output\" }"
else
# Output does not match expected result
json_output="{ \"state\": \"fail\", \"output\": \"$output\" }"
fi
# Print JSON output
echo "$json_output"
However when this json is returned from fly machine, I dont get valid json anymore inside stdout.
"{\"stdout\":\"{ state: fail, output: some-text }\\n\",\"stderr\":\"\",\"exit_code\":0,\"exit_signal\":0}"