June 2003
Beginner to intermediate
944 pages
43h 1m
English
if
if
test-cmds
Begin a conditional statement. The possible formats, shown here side by side, are:
iftest-cmdsiftest-cmdsiftest-cmdsthen then thencmds1cmds1cmds1fi else eliftest-cmdscmds2then ficmds2... elsecmdsnfi
Usually, the initial if and any elif lines execute one test or [ ] command (although any series of commands is permitted). When if succeeds (that is, the last of its test-cmds returns 0), cmds1 are performed; otherwise, each succeeding elif or else line is tried.
Read now
Unlock full access