I have a question about JSON files and bash scripting:
My goal is to create a JSON file that contains two keys, "key1" and "key2", each with multiple values stored in separate .txt files. The contents of the .txt files for each key are structured like this:
key1.txt:
val1
val2
val3
..
The structure of key2.txt is similar. Ultimately, I want the JSON file to look like this:
{
key1:
[ "val1"
"val2"
...
]
key2:
[ "val1"
"val2"
...
]
}
Does anyone know how to achieve this using bash scripting? Your help would be greatly appreciated!