Set env variables based on JSON string
I have a string that contains a JSON array. Each element of the array is another string. And for each element of the array, I want to end up with an environment variable with a name that is based on that string.
Extracting information from json file in bash
{ “user_agent”: “Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; Microsoft; Lumia 640 LTE) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537”, “operating_system”: “windows-phone”, “software_name”: “internet-explorer-mobile”, “software_engine”: “Trident”, “software_type”: “browser -> web-browser”, “hardware_type”: “mobile -> phone”, “popularity”: “common” } { “user_agent”: “Opera/9.80 (SpreadTrum; Opera Mini/4.4.31492/60.313; U; […]
Format JSON Date Value with Quotes for Bash Script
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.