Linux中变量$#,@,*的含义
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
转自:https://www.cnblogs.com/kaituorensheng/p/4002697.html
1 2 3 4 5 6 7 8 |
|
区别:@@*
- 相同点:都是引用所有参数
- 不同点:只有在双引号中体现出来。假设在脚本运行时写了三个参数(分别存储在112 3)则"3)则"*" 等价于 “112 3"(传递了一个参数);而“3"(传递了一个参数);而“@" 等价于 "1""1""2" "$3"(传递了三个参数)
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
例子一
#dels.sh echo "number:$#" echo "scname:$0" echo "first :$1" echo "second:$2" echo "argume:$@" echo "show parm list:$*" echo "show process id:$$" echo "show precomm stat: $?"
执行结果
1 2 3 4 5 6 7 8 9 |
|
推荐内容
阅读全文
AI总结




A beautiful web dashboard for Linux
最近提交(Master分支:7 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
相关推荐
查看更多
linux-dash

A beautiful web dashboard for Linux
linux-dash

A beautiful web dashboard for Linux
linux-dash

热门开源项目
活动日历
查看更多
直播时间 2025-04-09 14:34:18

樱花限定季|G-Star校园行&华中师范大学专场
直播时间 2025-04-07 14:51:20

樱花限定季|G-Star校园行&华中农业大学专场
直播时间 2025-03-26 14:30:09

开源工业物联实战!
直播时间 2025-03-25 14:30:17

Heygem.ai数字人超4000颗星火燎原!
直播时间 2025-03-13 18:32:35

全栈自研企业级AI平台:Java核心技术×私有化部署实战
所有评论(0)