I would like to define a simple abbreviation of a call to gs (ghostscript) via a shell script. The first argument(s) give all the files that should be merged, t
To access the last argument, in addition to Idelic's answer above, you can also do:
echo "${@: $#}"
This reads all of the arguments and prints them starting from the last one. This way, you can also access the N last arguments, for example for the last three arguments:
echo "${@: $#-2}"
$ ./script "what does" "this script" "do" "?"
this script do ?