Can you help me?
I want create a dynamic folder match, and if the folder name match an item in array, then an output will be triggered according the folder name. Here is an example.
#!/bin/bash
A=("banana"=>"yellow", "apple"=>"red", "watermelon"=>"green")
for dir in fruits/*
do
if [ "$dir" = "{banana, apple or watermelon}" ]; then
echo "The color of the fruit is: {fruit-color}"
fi
done
But I have no idea about how can I start, I only did this simple code above to you understand. Can you help me?
Thank you very much