May 2013
Beginner to intermediate
384 pages
7h 40m
English
Flow control in a program is handled by comparison and test statements. Bash also comes with several options to perform tests that are compatible with the Unix system-level features. We can use if, if else, and logical operators to perform tests and certain comparison operators to compare data items. There is also a command called test available to perform tests. Let us see how to use these.
We will have a look at all the different methods used for comparisons and performing tests:
if condition:if condition;
then
commands;
fielse if and else:if condition;
then
commands;
else if condition; then
commands;
else
commands;
fiNesting is also possible with if and else. The if conditions can be lengthy, ...
Read now
Unlock full access