linux-tutorial/codes/shell/输入和输出/参数计数.sh

12 lines
214 B
Bash
Raw Normal View History

2019-10-29 18:22:19 +08:00
#!/usr/bin/env bash
2019-10-10 08:56:31 +08:00
2019-05-10 11:17:57 +08:00
# getting the number of parameters
echo There were $# parameters supplied
#花括号里不能使用美元符号
params=$#
echo The last parameter is $params
echo The last parameter is ${!#}