比如下面的shell脚本文件: #===========test.sh: #! /bin/sh echo_line() { echo date echo "Wellcome to shell func!" } echo_hello() { echo "Hello World!" } #====================== 怎么在shell下调用以上两个函数啊? 为什么我用【./test.sh echo_hello】却什么也没有输出? 当然,我已经给test.sh加了可执行权限了。
各位大大~~~~大家辛苦了 小弟发一个脚本 ……………………………………………………………… function PING_STATUS () { local _ipadd _ipadd=$1 PING_COUNT=`ping -c 4 $1` if [ $? -eq 0 ];then # return 0 echo "ping is ok" #ping success elif [ $? -ne 0 ];then # return 1 echo "ping is error" #ping error fi } PING_STATUS $IP …………………...
在shell里,有2个函数: a() { export a b c echo -e "input" read a b c } b() {export a b c echo -e "input" read a b c } 我想另外些个函数代替 a 和 b中的共同语句,并且在 a,b中调用,怎么做啊?