Skip to Main Content
Fundamentals of Linux
book

Fundamentals of Linux

by Oliver Pelz
June 2018
Beginner content levelBeginner
234 pages
5h 36m
English
Packt Publishing
Content preview from Fundamentals of Linux

Implementing Bash shell scripting

Besides the logical and and or expressions that we used in the previous section, if we need to make a decision based on a command's exit status, variable value, command output, and so on, we need to understand the if statement or conditional branch. In plain words, the if statement means that, based on some condition, our script or command line should perform one action, otherwise it should perform something else.

Let's work with the exit code from the previous section again to demonstrate:

In this example, we issued the ls command to see the content of the oiip home directory. We stored the exit status of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux in a Nutshell, 6th Edition

Linux in a Nutshell, 6th Edition

Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
Linux in Action

Linux in Action

David Clinton
Hands-On System Programming with Linux

Hands-On System Programming with Linux

Kaiwan N. Billimoria, Tigran Aivazian

Publisher Resources

ISBN: 9781789530957Supplemental Content