直接看示例:
[root@localhost xly]# cat t.sh
#!/bin/bash
echo $#
echo $@
[root@localhost xly]# sh t.sh
0
[root@localhost xly]# sh t.sh a b c
3
a b c
说明:
- $@表示所有参数
- $#表示所有参数的个数
https://zhidao.baidu.com/question/412833470.html
直接看示例:
[root@localhost xly]# cat t.sh
#!/bin/bash
echo $#
echo $@
[root@localhost xly]# sh t.sh
0
[root@localhost xly]# sh t.sh a b c
3
a b c
说明:
https://zhidao.baidu.com/question/412833470.html
微信扫码登录