#!/bin/bash
function demo()
{
echo "all function args : $*"
echo "the first arg : $1"
echo "the second arg : $2"
echo "the third arg : $3"
}
# call the function
demo -f foo bar
function demo()
{
echo "all function args : $*"
echo "the first arg : $1"
echo "the second arg : $2"
echo "the third arg : $3"
}
# call the function
demo -f foo bar
本文介绍了bash中函数的定义和使用方法,包括如何传递参数并获取参数值。
4563

被折叠的 条评论
为什么被折叠?



