#!/bin/bash func() { mylist=("$@") echo ${#mylist[@]} } list=("aaa" "bbb") func "${list[@]}"