Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Use case for Complicated Conditional Statements in Bash


    Lots of if and if else statements are hard to read and tough to maintain in any language, and bash is no exception. In this lesson, we’ll learn how to use case, bash’s construct for a switch statement. In bash, case actually does pattern matching, which gives some great flexibility. We’ll write a script that will uncompress a variety of different archive file types (like .tar or .zip), based on their file extension.