shell脚本变量$#,$*,$$,$@,$0,$1,$2,$?的含义
来源:互联网 发布:手机店刷机软件 编辑:程序博客网 时间:2024/05/16 14:35
参数说明
1:$# 表示执行脚本传入参数的个数
2:$* 表示执行脚本传入参数列表
3:$$ 表示进程id
4:$@表示执行脚本传入所有参数
5:$0 表示执行脚本名称
6:$1 表示第一个参数
7:$2 表示第二个参数
8:$? 表示脚本执行状态0正常,其他表示有错误
实验及结果
#!/bin/sh
echo "parm number is : $#"
echo "parm list is : $*"
echo "all parm is : $@"
echo "process is : $$"
echo "file name is : $0"
echo "the first parm is : $1"
echo "stat is : $?"
-----------------------------执行及结果------------------------------
执行:sh shellTest.sh "the first parm " "the second parm"
parm number is : 2
parm list is : the first parm the second parm
all parm is : the first parm the second parm
process is : 28669
file name is : shellTest.sh
the first parm is : the first parm
stat is : 0
0 0
- shell脚本变量$#,$*,$$,$@,$0,$1,$2,$?的含义
- shell脚本变量$#,$*,$$,$@,$0,$1,$2,$?的含义
- shell脚本变量$#,$*,$$,$@,$0,$1,$2,$?的含义
- shell变量$#,$@,$0,$1,$2的含义
- shell变量$#,$@,$0,$1,$2的含义
- shell变量$#,$@,$0,$1,$2的含义
- Linux Shell脚本编程--变量$#,$@,$*,$?,$0,$1,$2的含义解释
- Linux Shell脚本编程--变量$#,$@,$*,$?,$0,$1,$2的含义解释
- Linux Shell脚本编程--变量$#,$@,$*,$?,$0,$1,$2的含义解释
- shell脚本中$#、$0、$@等特殊变量的含义
- shell脚本中$#、$0、$@等特殊变量的含义
- linux 中shell脚本 $0,$?,$! 等变量的含义
- shell脚本中$#、$0、$@等特殊变量的含义
- shell脚本中$$等变量的含义
- linux shell -----1 变量$#,$@,$0,$1,$2的含义解释
- linux shell -----1 变量$#,$@,$0,$1,$2的含义解释
- linux中shell变量$#,$@,$0,$1,$2的含义解释
- linux中shell变量$#,$@,$0,$1,$2的含义解释:
- 如何监控项目里所有UI线程的操作(实战,BlockCanary)?
- Android和ios微信浏览器中按钮显示不一样的问题
- Java嵌入式数据库H2学习总结(二)——在Web应用程序中使用H2数据库
- 安卓手册 第零章(面试)
- Sping_mvc下创建session对象
- shell脚本变量$#,$*,$$,$@,$0,$1,$2,$?的含义
- iOS点击button60秒倒计时
- java.util.concurrent.ExecutionException:
- Cocos2d-x程序在Android下的启动过程
- [翻译]Objective-C 2015新特性
- html5 百度 google地图定位关键字搜索附近
- 火狐中打开新的标签页出现白屏
- Why Python?
- Python Tutorial 学习笔记4 ——Module