I used to read the json file using
recordtype=python -c 'import sys,json,ast;print ast.literal_eval(json.dumps(json.load(sys.stdin)["record"].keys())) < 1.json
I got the value of recordtype like
['1', '2', '3', '4']
In order for me to loop to the recordtype, I need the array like this
(1 2 3 4)
How to convert the above to this type of array? And if its possible to loop through the above value? I used
for type in "${recordtype[@]}"
The json would be:
{"modes":["a","b","c"],"recordtype":{"1":{"mode":"a","inputpath":"/us/","archive":""},"2":{"mode":"b","inputpath":"","archive":""}}}
1.jsontype sample data, please.