$1
是第一个参数。
$@
就是它们的全部。
如何找到传递给 shell 的最后一个参数 脚本?
最佳答案
这仅适用于 Bash:
echo "${@: -1}"
关于shell - 获取传递给 shell 脚本的最后一个参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1853946/
$1
是第一个参数。
$@
就是它们的全部。
如何找到传递给 shell 的最后一个参数 脚本?
最佳答案
这仅适用于 Bash:
echo "${@: -1}"
关于shell - 获取传递给 shell 脚本的最后一个参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1853946/
相关文章:
shell - 如何使用批处理在/sdcard 上 adb chmod 750
function - 如何在 MATLAB 中处理函数参数的名称/值对
shell - 从 localhost 授予对 root 的访问权限
linux - Telnet 到嵌入式 linux 板 : command not found
windows - CMD/windows 批处理 : how to pass a double quote and a larger than sign in a command argument?