Difference between revisions of "CLI Flow Control"

From FreekiWiki
Jump to navigation Jump to search
 
Line 6: Line 6:
 
= Flow Control Techniques =
 
= Flow Control Techniques =
 
== if/then statement ==
 
== if/then statement ==
 +
 +
 +
[[Category:CLI Quizes]]
 +
[[Category:Classes]]

Revision as of 13:43, 8 March 2008

Introduction

The command line interpreter (BASH) is the program that runs when you hit enter on the command line. It is what knows how to find the command that you've asked it to run and it passes the options and arguments that you typed to that command to execute. However BASH is much more than just a command line interpreter. It's also a programming language. This means that you can use flow control techniques to guide the execution flow of your commands. Wow, that was wordy, what did I mean? What I mean is that you can use some techniques to decide if you want to run a command or possibly to run a command many times in a loop. Let's look at some simple examples.


Flow Control Techniques

if/then statement