Jump to ratings and reviews
Rate this book

Shell Scripting: How to Automate Command Line Tasks Using Bash Scripting and Shell Programming

Rate this book
Shell Scripting Made Easy If you want to learn how to write shell scripts like a pro, solve real-world problems, or automate repetitive and complex tasks, read on.

Hello. My name is Jason Cannon and I'm the author of Linux for Beginners, Python Programming for Beginners, and an instructor to thousands of satisfied students. I started my IT career in the late 1990's as a Unix and Linux System Engineer and I'll be sharing my real-world shell scripting and bash programming experience with you throughout this book.

By the end of this book you will be able to create shell scripts with ease. You'll learn how to take tedious and repetitive tasks and turn them into programs that will save you time and simplify your life on Linux, Unix, or MAC systems.

Here is what you will get and learn by reading this Shell Scripting book:
A step-by-step process of writing shell scripts that solve real-world problems. The #1 thing you must do every time you create a shell script. How to quickly find and fix the most shell scripting errors. How to accept input from a user and then make decisions on that input. How to accept and process command line arguments. What special variables are available, how to use them in your shell scripts, and when to do so. A shell script creation check list -- You'll never have to guess what to include in each of your shell scripts again. Just use this simple check list. A shell script template (boilerplate). Use this format for each of your shell scripts. It shows exactly what to include and where everything goes. Eliminate guesswork! Practice exercises with solutions so you can start using what you learn right away. Real-world examples of shell scripts from my personal collection. A download that contains the scripts used in the book and lessons. You'll be able to look at and experiment with everything you're learning. Learn to Program Using Any Shell Scirpting Language What you learn in this book can be applied to any shell, however the focus is on the bash shell and you'll learn some really advanced bash features. Again, whether you're using bash, bourne (sh), KornShell (ksh), C shell (csh), Z shell (zsh), or even the tcsh shell, you'll be able to put what you learn in this book to good use.

Perfect for Linux, Unix, Mac and More! Also, you'll be able to use these scripts on any Linux environment including Ubuntu, Debian, Linux Mint, RedHat, Fedora, OpenSUSE, Slackware, Kali Linux and more. You're scripts will even run on other operating systems such as Apple's Mac OS X, Oracle's Solaris, IBM's AIX, HP's HP-UX, FreeBSD, NetBSD, and OpenBSD.

Scroll up, click the Buy Now With 1 Click button and get started learning Linux today!

98 pages, Paperback

First published September 15, 2015

1081 people are currently reading
478 people want to read

About the author

Jason Cannon

50 books17 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
153 (46%)
4 stars
110 (33%)
3 stars
58 (17%)
2 stars
9 (2%)
1 star
2 (<1%)
Displaying 1 - 30 of 32 reviews
Profile Image for Maciel.
91 reviews47 followers
April 21, 2020
Good intro for.beginners

Very useful and handy tricks to make your scripts do more for you. It's a very basic book but it a good start
Profile Image for Max Darling.
74 reviews4 followers
March 16, 2022
A decent bash primer. But I just checked the bash reference manual and it took me 45 seconds of scrolling to find ~everything in this book. The book has some exercises, that's an advantage! But you can also find better ones online in minutes.

If I could do it over, I'd just peep the manual as needed.

1 review
January 22, 2018
Sets the record straight

This book is good for both beginners and those who have been automating on the command line for a while, as it intelligently focuses on many of the most important, sometimes long-forgotten fundamentals, with the goal of helping the reader apply the 101s to solve actual real-life problems or enhance practical workflows.

It's easy to pick up some bad habits, or lose knowledge, over time, of useful practices or methods, and a read of this guide followed up by semi-regular reviews will be the WD-40 to many people's squeaky scripting practices, I think no matter the level of experience.

While you won't find scripting examples beyond even just 50 lines, this book is a toolbox more than a preconstructed assembly line. Its aim seems to impart wisdom on how this piece can help you in this area, and reminds us all about this other piece, which we forgot about but begs to be included in our existing workflow. And over time, this toolbox will increase the efficiency of, and perhaps even size/capabilities of our own personal assembly lines.

As toolbox as it is, it's like any other toolbox and assumes that the reader knows enough about most of the individual tools and has worked with enough of them over time to make use of what's included in the box ("book").

Don't buy until you've written a few of your own scripts/functions and want to take the next step in actually becoming good at this.
Profile Image for Colin.
16 reviews
August 5, 2019
Brief, but sufficient overview on the basics of working with shell scripts. I've been working with shell scripts for a few years, so most of this was review, but it's a quick read and I found a few tips I hadn't heard of (or had forgotten about).

One thought: if you are using this as a guide for your own scripts, be aware that the examples in this book are all focused on bash (unless otherwise noted). bash is not the default shell on all systems and bash is not 100% POSIX compatible. Just make sure you know what shell you are using.
1 review
January 2, 2023
Actually pretty good but a bit short

As my heading says this book was actually useful but it's a whirlwind tour of the basics of shell scripting. I actually used this as a refresher for syntax but in addition I learned a few new things about Shell Scripting & some Linux system stuff. You probably shouldn't use this book if you have absolutely zero knowledge of general programming or basic Linux system info/commands though. It's not overly complex though and it's well written.
Profile Image for Dave.
Author 1 book1 follower
April 24, 2019
The content is great. Excellent for beginners, well structured and relevant.

However, it is _far_ too short. Sadly, it feels more like a way to advertise for the website on the back and online training courses. For beginners, I’d have to recommend that if you are going to buy a book, make it a larger one with more content.
Profile Image for Philippe Fanaro.
158 reviews1 follower
July 28, 2019
This is an amazing book for those entering the field. However, it won't be enough for more experienced shell programmers. For example, one thing that was kind of disappointing for me was the lack of a tutorial on how to create flags for new commands.

Overall, I would give it 4.5 stars, but since it is not possible, I will leave it with 5 because it's well written and succinct.
Profile Image for Algenis.
17 reviews
March 29, 2024
Room to improve.

Awesome for beginners and a good reference for experts. By reading this book, you gained the foundation to keep learning and to create simple bash scripts. The book is short with the right amount of information to get you on the right track of bash scripting. I hope the author considered reviewing, updating, and adding more in a future release.
7 reviews
July 2, 2017
Clear and simple

Gives simple and clear explanations for key shell scripting concepts. Good examples and exercises which test the material make this an excellent choice for shell script newbies.
Profile Image for Ashraf Bashir.
226 reviews137 followers
September 14, 2017
Very basic! It should be called "Short Introduction to Shell Scripting Basics". On the other hand, it is very descriptive and full of code snippets. So overall, it is a very useful intro. book for beginners.
1 review
Read
October 20, 2020
note when i started to read this book: hello im looking into learning in shell scripting at a such young age since i make games that are scripted.

note today: this book is great i think you should read this since theres a lot of keys to learn how to shell script!!

2 reviews
December 25, 2020
Straight to the point

I bought this book when it was only 3 dollars. For that price is a must buy. In 1 day of reading I can do all that i need (simple automations), if you dig it you can do much more advanced stuff too
Profile Image for Giorgi Jibladze.
10 reviews2 followers
September 4, 2022
It covers only absolute basic topics and not the fundamental ideas around shell scripting. Helpful for beginners. Describes things with the shortest possible and most genuine sentences. You can easily read it completely in an hour.
Profile Image for Tom Hughes.
68 reviews17 followers
September 9, 2023
Good for Novices

If you already know scripting 101, then this book is for you as the next step. Really good information for a novice that helps troubleshooting, controlling, and using scripting to automate your workflows.
64 reviews
July 8, 2024
Substituting for another shell scripting book I read online. I don't know how I made it this far in life without knowing a lick of bash, now I can't imagine life without it (All the more shocking that this radical lifestyle transformation has happened over the course of last week)
Profile Image for Lex Littleton.
12 reviews1 follower
April 2, 2025
Way too short, not very useful IMO. Beginner focused to a fault. I started reading The Linux Command Line after this. I'm about 15% through it and already it's much more practical in terms of commands and syntax for shell scripting.
Profile Image for Lavender.
1,164 reviews13 followers
May 7, 2018
A nice little introduction to shell scripting with easy to follow examples and exercises to test what you learned.
8 reviews
July 10, 2018
It's a good refresher book. Works great for beginners too.
1 review
April 19, 2020
Brief, but to the point

Very practical book. I found a few typos, but otherwise it is perfect. It is brief, but complete. It took me half a a day to go through. I recommend it.
39 reviews2 followers
June 10, 2020
Great clear introduction to shell scripting
3 reviews
July 19, 2020
Quick and useful read

Quick tips and learned some useful tips around logging and debugging in bash. Easy read to help quickly improve scripting skills.
17 reviews
September 22, 2020
Great compact book that lays out a solid foundation for shell scripting. Each chapter has a few practical exercises at the end which helps learning.
Profile Image for Srinivasan Nanduri.
478 reviews12 followers
December 27, 2021
A very useful resource whether you are getting started with shell scripting (or) if you want to refresh the scripting concepts.
3 reviews1 follower
April 28, 2020
Useful book

Useful book but too short. I should check other author’s discount courses on linuxacademy. Would recommend this book to my collegues
Displaying 1 - 30 of 32 reviews

Can't find what you're looking for?

Get help and learn more about the design.