[root@localhosts ~]# cat 2.sh
function hello()
#在这里我们定义一个模块叫hello
{
printf "hello\n"
printf "hello\n"
printf "hello\n"
}
以上五行就是hello模块里面的内容
function word()
这里我们定义了一个word的模块
{
printf "word\n"
}
hello
word
这里就是我们使用hello和word模块
输出结果
[root@localhosts ~]# bash 2.sh
hello
hello
hello
word
不输出word模块里面的内容
[root@localhosts ~]# cat 2.sh
function hello()
{
printf "hello\n"
printf "hello\n"
printf "hello\n"
}
function word()
{
printf "word\n"
}
hello
[root@localhosts ~]# bash 2.sh
hello
hello
hello
两个模块都不输出
[root@localhosts ~]# cat 2.sh
function hello()
{
printf "hello\n"
printf "hello\n"
printf "hello\n"
}
function word()
{
printf "word\n"
}
[root@localhosts ~]# bash 2.sh