shell脚本变量$#,$*,$$,$@,$0,$1,$2,$?的含义
来源:互联网 发布:mac用hdmi连接电视 编辑:程序博客网 时间:2024/05/16 17:43
参数说明
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的含义解释:
- EventBus的简单使用
- 部分安卓手机点击输入框,输入法会将输入框遮住问题
- 物料主档屏幕增强实例一.
- php环境搭建phpeclipse
- java实现—n阶奇数幻方
- shell脚本变量$#,$*,$$,$@,$0,$1,$2,$?的含义
- EA13 反向工程中文乱码解决方案
- C/C++语言宏的冷知识,内置宏,__FILE__,__LINE__,##, 可变参的宏...和__VA_ARGS__
- SpringBoot外置tomcat
- Android 之路8---Java基础4
- MyBatis配置:在控制台打印SQL语句
- oracle数据库中varchar2陷阱
- Java设计模式之单例模式
- 我在读pyTorch文档(三)