How do I search an element in shell script
<p>I have an array </p>

<p>declare -a fruits=("apple" "banana" "guava" "cherry" "mango"  "litchi")</p>

<p>I need to write a shell script, it can take multiple arguments (comma separated). It should check each argument against the array- fruits in case argument doesn't match it should exit stating argument is not in array. It should return all the invalid arguments</p>

<p>E.g ./dummy.sh carrot,potato,cabbage</p>

<p>o/p: carrot,potato,cabbage not found in array</p>

<p>e.g 2 ./dummy.sh banana,mango
o/p banana,mango found in list</p>