[ Thanks to Andrew
Weber for this link. ]
“Conditionals
“Conditions are elements that you will use often. With
conditions you will test for an element and then create a response
to the results of that test. In most situations, conditions will be
a very important part of your scripts.“In the example below, the if starts the condition and then
inside the brackets, which equates to the test command, is the
element that is tested, is the number 15 equal to (-eq) the number
15, of course it is true and will exit with a “0” to
indicate it is true. So the then will evaluate the zero and echo
the Success line. If it exited with any number besides
“0”, it would indicate that it failed so the second
Failure line would echo.”