×

Tags

探索与 "bash" 相关的所有文章

bash

共有 22 篇文章
Bash 的 while 循环语句

#Bash 的 while 循环语句Bash 的 while 循环语句的语法为: 123456while 条件命令do 命令 ...done 只要条件为真,就执行循环。 其中,条件命令返回成功(0)时为真(true),返回失败(非 0)时为假(false)。 如果省略(部分)换行,则需要使用分号(;)区分: 12while 条件命令; do 命令; 命令; done 示例: 1234567number=0while [ "$number" -lt 10 ] # 只要 "$number" 小于 10,就循环执行do echo &qu...

Bash 的变量

#Bash 的变量Bash 中的变量定义语法如下: 12变量名=值 注意,等号(=)两边不能有空格。 变量名的命名应当遵循如下规则: 只能包含字母,数字和下划线(_),并且不能以数字开头。 不能使...