Suppose I have two lists:
lista="a b c d"
listb="e f"
I would like to write a function that returns the number of items on a given list:
>>foo $lista
4
>>foo $listb
2
I've tried using ${#<varname>[@]}
syntax, also ${#!<varname>[@]}
, unsuccessfully.
Thanks