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?
sed
commands and other stuff interesting for us? Your example should look like this: pastebin.com/vyp0drSs Do you was too lazy to make a simple example out of it? I don't understand why somebody should post something like this.…Complete
meansProvide all parts needed to reproduce the problem
and means not post your whole shell script.