One - One Code All

Blog Content

linux运行脚本函数

Linux-Mac   2008-10-11 22:20:24

1、同一脚本文件中的函数:

#!/bin/sh
function func1()
{
echo $1
}
func1 "Hello world!"


2、其它脚本文件中的函数:
func.sh文件内容如下(其中定义了函数func1,需要1个参数):

#!/bin/sh
function func1()
{
echo $1
}


主程序脚本:

#!/bin/sh
. func.sh
func1 "Hello world!"



上一篇:周易易经全文
下一篇:易经系辞 全文(上下)

The minute you think of giving up, think of the reason why you held on so long.