参数计数

5年以前  |  阅读数:489 次  |  编程语言:Shell 
#!/bin/bash
# getting the number of parameters

echo There were $# parameters supplied

#花括号里不能使用美元符号
params=$#

echo The last parameter is $params
echo The last parameter is ${!#}

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8