Work the Shell - Conditional Statements and Flow Control
There are, of course, many different ways to create more-advanced and sophisticated scripts, notably including shell script functions, but we'll delve into those as we proceed. I'm a big fan of just doing rather than talking around the topic forever.
I hope that's enough on the basics of flow control and conditional expression evaluation in this column. If you've some questions, don't forget that man sh produces more information on the power and capabilities of the Bourne Shell.
I don't know about you, but I'm eager to get moving onto some more complex and interesting scripting tasks, and I invite you to let me know via e-mail if there are specific types of scripts that you're interested in seeing featured here.
Dave Taylor is a 25-year veteran of UNIX, creator of The Elm Mail System and most recently author of both the best-selling Wicked Cool Shell Scripts and Teach Yourself Unix in 24 Hours, among his 16 technical books. His main Web site is at www.intuitive.com.
Dave Taylor has been hacking shell scripts for over thirty years. Really. He's the author of the popular "Wicked Cool Shell Scripts" and can be found on Twitter as @DaveTaylor and more generally at www.DaveTaylorOnline.com.
- Ensono M.O.
- Understanding OpenStack's Success
- Own Your DNS Data
- Teradici's Cloud Access Platform: "Plug & Play" Cloud for the Enterprise
- Simple Server Hardening
- Understanding Firewalld in Multi-Zone Configurations
- Returning Values from Bash Functions
- From vs. to + for Microsoft and Linux
- Bash Shell Script: Building a Better March Madness Bracket
- The Weather Outside Is Frightful (Or Is It?)