Example:
BASH ARRAY FRUITS=("apple" "banana" "orange")
fruit.json
{
"fruit": [
"apple",
"orange",
"pomegranate",
"apricot",
"mango"
]
}
What I need to do:
- Compare Bash fruit array against fruit.json file and output if it matches all the elements.
- If the fruit.json file is missing a fruit element from the bash array I have to display which one it is.
- If the fruit.json file has any extra fruit elements that are not in the bash array I have to output it.
I managed to figure out the first two tasks but I am having trouble with the third. Any ideas on how to achieve the third using bash and jq?