问题描述:

How can I get second argument from the end of arguments line in bash?

网友答案:

one way in Bash

set -- ${@:(-2)}
echo $1

or simply

echo ${@:(-2):1}
网友答案:

To print the second last argument use:

echo "${@:(-2):1}"
相关阅读:
Top