0

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.

John Kugelman
  • 330,190
  • 66
  • 504
  • 555

0 Answers0