Go ProSign in

This Lesson is for Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In

Automate Daily Development Tasks with Bash

Automate Daily Development Tasks with Bash


    Use Conditional Statements in Bash

    Cameron NokesCameron Nokes

    Knowing how conditionals work in bash open up a world of scripting possibilities. We’ll learn the basic syntax, including if, else, and elif. Then we'll look at a few of the "primary" operators you can leverage in a conditional statement such as = for string equality, -eq for numeric equality, and -e to check if a file exists. After that, we'll use conditional statements to create a function that asserts that the HTTP status of a given URL is between 200 and 299.

    You must be a Member to view code