The conventional solution would be to put any required arguments first, and leave variable arguments last.
Code:
#!/bin/sh
file=$1
shift
echo "file is $file, remaining arguments are" "$@"
The index of the last command line argument is in $#, and you can use
eval to print it.
Code:
eval echo Last argument is ${$#}
eval is tricky to learn, and you need to understand proper
quoting rules etc. to use it.