shell脚本之函数的参数

Posted 旅行者3468号

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了shell脚本之函数的参数相关的知识,希望对你有一定的参考价值。

#! /bin/bash
echo use function
hello()
{
echo how many parameters in the function:$#;
echo the name of this function is $0;
echo the first parameters is :$1;
echo the second parameters is :$2;

}
hello "hello" "world"

  

[[email protected] Desktop]# ./hello.sh 
use function
how many parameters in the function:2
the name of this function is ./hello.sh
the first parameters is :hello
the second parameters is :world

  

以上是关于shell脚本之函数的参数的主要内容,如果未能解决你的问题,请参考以下文章