shell脚本接收参数

时间:2021-04-07 20:36:44   收藏:0   阅读:29

1、接收固定参数

#!/bin/bash
echo "name of this file is `basename $0` --as the same time called as $0"
echo "first param is : $1"
echo "second param is : $2"

运行结果:

空参执行

然后带两个参数执行

技术分享图片

原文:https://www.cnblogs.com/yanxiaoseng/p/14628987.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!