Getting the last argument passed to a shell script

This is Bash-only:

echo "${@: -1}"

Leave a Comment