ex59.sh
来自「Shall高级编程」· Shell 代码 · 共 38 行
SH
38 行
#!/bin/bashJUST_A_SECOND=1funky (){ # This is about as simple as functions get. echo "This is a funky function." echo "Now exiting funky function."} # Function declaration must precede call.fun (){ # A somewhat more complex function. i=0 REPEATS=30 echo echo "And now the fun really begins." echo sleep $JUST_A_SECOND # Hey, wait a second! while [ $i -lt $REPEATS ] do echo "----------FUNCTIONS---------->" echo "<------------ARE-------------" echo "<------------FUN------------>" echo let "i+=1" done} # Now, call the functions.funkyfunexit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?