Shell

推荐列表 站点导航

当前位置:首页 > 脚本编程 > Shell >

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

来源:网络整理  作者:wy  发布时间:2020-12-23 03:36
本文介绍了在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 命令

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://www.juheyunku.com/jiaob/shell/7888.shtml

相关文章
最新文章
PHP生成奖状 PHP生成奖状

时间:2021-01-06

python实现输入五个数并求 python实现输入五个数并求

时间:2021-01-06

php检测网站是否正常打开 php检测网站是否正常打开

时间:2021-01-05

python怎么右对齐 python怎么右对齐

时间:2021-01-05

Python3爬虫入门之Python3的安 Python3爬虫入门之Python3的安

时间:2021-01-05

如何用PHP接收http请求头信 如何用PHP接收http请求头信

时间:2021-01-05

数据库怎么连接用php写的 数据库怎么连接用php写的

时间:2021-01-05

php后缀怎么打开 php后缀怎么打开

时间:2021-01-05

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

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

2020-12-23 编辑:wy

有如下的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命令行参数

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://www.juheyunku.com/jiaob/shell/7888.shtml

相关文章

风云图片

推荐阅读

返回Shell频道首页