Bash pass both array and non-array parameter to function
Your code is almost complete. Just add shift
after the assignment to $val
, it will remove the first element from the $@
array.
...
val=$1
shift
arr=("$@")
...
Your code is almost complete. Just add shift
after the assignment to $val
, it will remove the first element from the $@
array.
...
val=$1
shift
arr=("$@")
...