It is surprising me that I do not find the answer after 1 hour search for this. I would like to pass an array to my script like this:
test.sh argument1 array
If this is your command:
test.sh argument1 ${array[*]} argument2
You can read the array into test.sh like this:
arg1=$1 arg2=${2[*]} arg3=$3
It will complain at you ("bad substitution"), but will work.