I'm wondering how to obtain the last argument passed to a bash function, like this:
#!/bin/bash
function hello() {
all=$@ # all arguments
n=$# # number of arguments
first_arg=$1 # argument one
last_arg= ??? # How to get the last argument?
}
How to set $last_arg
to the value of the last argument passed to the function?