bash语句总结
shell逻辑语句总结
if else elif
1 | |

while
1 | |

for
1 | |


case
1 | |

until
和while差不多但是,当为错误时进入循环,而不是正确进入循环
1 | |
break&continue
1 | |

select
实际上这并不是一个逻辑语句,其主要用于创建菜单。并且其是一个死循环,记得使用break语句来退出循环。
1 | |

shift
1 | |

参考资料
https://math.ecnu.edu.cn/~jypan/Teaching/Linux/Linux08/lect12_Shell_Prog.pdf
https://math.ecnu.edu.cn/~jypan/Teaching/Linux/Linux08/lect14_Review.pdf
bash语句总结
https://ysc2.github.io/ysc2.github.io/2023/12/12/bash语句总结/