I have a shell script that looks like this
#!/bin/bash
declare -a arr=("foo" "bar" "baz")
myFunc(){
if [[ ${#$1[@]} -gt 0 ]]; then
for item in $1;do
echo "item"
done
}
So, I am trying to first check the item count in the array, then loop through to use the different items in the array. Problem is that I don't know how to implement this.