#!/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"
运行结果:
空参执行
然后带两个参数执行
shell脚本接收参数
原文:https://www.cnblogs.com/yanxiaoseng/p/14628987.html