shell/处理用户输入/参数计数.sh

11 lines
205 B
Bash
Raw Normal View History

2016-05-13 21:42:54 +08:00
#!/bin/bash
# getting the number of parameters
echo There were $# parameters supplied
#花括号里不能使用美元符号
params=$#
echo The last parameter is $params
echo The last parameter is ${!#}