How to skip the first argument in $@?
Use the offset parameter expansion
#!/bin/bash
for i in "${@:2}"; do
echo $i
done
Example
$ func(){ for i in "${@:2}"; do echo "$i"; done;}; func one two three
two
three
Use shift
command:
FIRST_ARG="$1"
shift
REST_ARGS="$@"