摘要:
[root@a ~]#cat break.sh #!/bin/bash while : #其中“:”表示while循环的条件永远为真的意思 do read -p "Enter a number [1-5]: " num case $num in 1|2|3|4|5) echo "It's OK" ; 阅读全文
2019年5月13日 #
摘要:
shell函数,完成特定功能的代码片段(代码模块化)。函数必须先定义,然后才能使用。 shell函数的定义: 方法一: 函数名() { 函数要实现的功能代码 } 方法二:function 函数名 { 函数要实现的功能代码 } shell函数的调用: 函数名 函数名 参数1 参数2 [root@a ~ 阅读全文