Suspect it's a newbie mistake that I'm making, but in an attempt to parse a json such as
{"current_observation": {"observation_time": "Last Updated on July 4, 12:53 PM CDT" } }
from within a script such as
#!/bin/sh
jq '.' test.json
I get an error response from ./test.sh as follows
syntax error, unexpected INVALID_CHARACTER, expecting $end '.'1 compile error
Now if I do a jq '.' test.json from the command line in terminal, it performs as expected, but when attempting to use it within a script it fails as detailed.
Anyone able to point out my error?
bash != sh, try switching the shebang to#!/bin/bashor running it asbash scriptname