#!/bin/bash #use: $0 10 20 30 function func(){ local num=$@ #printf "$num\n" for i in $num do echo "$i" done } func $1 $2 $3
#!/bin/bash #use: $0 10 20 30 40 50 60 ...... NUM=$@ function func(){ local num=$@ #printf "$num\n" for i in $num do echo "$i" done } func $NUM