6.4. Conclusion

Using the && and || operators is very helpful when creating decision-making statements. It can also save your skin if you do not want the second command executed because the first failed. These methods give you control over what actions are to be taken based on the exit status of the commands on the left-hand side of the && or ||.

Get Linux and Unix Shell Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.