Control Statements in Shell script

Control Statements in Shell script

  • Without control statements, execution within a shell scripts flows from one statement to the next in succession.
  • Control statements control the flow of execution in a programming language

The three most common types of control statements:

– conditionals: if/then/else, case, …
– loop statements: while, for, until, do, …
– branch statements: subroutine calls (good), goto (bad)