Execute flow control in shell scripts

1. Loop execution flow

 Assume that the current network environment is the 192.168.1 network segment

Detect which of the 10 hosts 1-10 can communicate with the current host

Display the ip that can realize network communication in a list form

 

 Execution Flow Judgment Method Conditional Judgment Statement

How to write a single condition

 

 

 

 How to write multiple conditions

 

 the case

 

  Select Execution Flow Control

case statement

 

 project

 

 

  

expect automatic answer statement

 

 

 

 

 

 

 

 

 how to write a block

 

 

 

 practise

Detect 192.168.1.5-192.168.1.10 which host can communicate with 192.168.1.0 and display the ip

 

 

  controller in script

continue Terminates the current current loop and advances to the next loop

break Terminates all actions of the current statement and performs other actions outside the statement

exit script exit'

 

=================================

 

 

 ==========================

 

 ====================

 

====================

 just want to end the function

 

 

Guess you like

Origin blog.csdn.net/weixin_59945551/article/details/132075071