In the Bash programming language (scripting language), this article introduces how to specify from the nth to the nth element of the argument array $@.
testf(){
echo $1 # => hoge
echo $2 # => fuga
echo $3 # => foo
echo "${@:2}" # => fuga foo bar
echo "${@:2:3}" # => fuga foo bar
echo "${@:2:1}" # => fuga
}
testf hoge fuga foo bar
shell - Process all arguments except the first one (in a bash script) - Stack Overflow
This way, you can specify any range of the array.
This makes Bash scripting more concise. Please make use of it.