基本的脚本函数

4年以前  |  阅读数:370 次  |  编程语言:Shell 
#!/bin/bash

# using a function in script

function func1 {
    echo "This is an example of a function"
}

count=1
while [ $count -le 5 ]
do
    func1
    count=$[ $count+1 ]
done
echo "This is the end of the loop"
func1
echo "Now this is the end of the script"

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8