教程集 www.jiaochengji.com
教程集 >  脚本编程  >  shell  >  正文 shell脚本中使用命令行参数的例子

shell脚本中使用命令行参数的例子

发布时间:2014-12-22   编辑:jiaochengji.com
本文介绍了在shell脚本中使用命令行参数的方法,一个小例子,大家做个参考。

有如下的shell脚本代码:
parameter.sh
 

复制代码 代码示例:

#!/bin/bash
 
echo "show all the parameter    : "
 
echo "the scirpt name is        : $0"
echo "the first  parameter is   : $1"
echo "the second parameter is   : $2"
echo "the third  parameter is   : $3"
echo "the four   parameter is   : $4"
echo "the five   parameter is   : $5"

exit

运行该shell脚本,接收命令行参数,如下图:
shell命令行参数

您可能感兴趣的文章:
shell脚本中使用命令行参数的例子
linux shell脚本命令行参数示例
inux shell初级入门教程
Linux Source命令解析
深入解析tcsh的初始化配置文件
shell内部命令使用详解
python shell是什么
shell脚本命令行参数用法简介
bash shell脚本执行的几种方法
Shell脚本参数传递方法

关键词: linux shell  shell  shell参数  命令行参数   
[关闭]
~ ~