Hi I have a bash script which i am reading from a JSON using jq and writing to another JSON object.
The dates from he feed are formatted in ISO8601 like “2024-05-16T08:00:00-05:00”, bash doesnt like.
I need the dates in friendly format so in my script an example of
reading the raw JSON I have in use the epoch time: 1715864400 from the feed and format to
friendly with this one liner.
dt=$(date -d @$(cat “${DrawC}” | jq ‘.[].EpochTime | .’))
But it is not quoted, I need to have it double quoted to read the string in my new file otherwise
I get an ‘Invalid numeric literal error.
I’ve tried formatting, using quotes in all kinds of ways around the variable.
Cant seem to get it, searched but most of the results seem to think I’m asking
how to use quotes in a bash script.
Thanks
1