Jump to ratings and reviews
Rate this book

Classic Shell Scripting

Rate this book
Shell scripting skills never go out of style. It's the shell that unlocks the real potential of Unix. Shell scripting is essential for Unix users and system administrators-a way to quickly harness and customize the full power of any Unix system. With shell scripts, you can combine the fundamental Unix text and file processing commands to crunch data and automate repetitive tasks. But beneath this simple promise lies a treacherous ocean of variations in Unix commands and standards. Classic Shell Scripting is written to help you reliably navigate these tricky waters.Writing shell scripts requires more than just a knowledge of the shell language, it also requires familiarity with the individual Unix why each one is there, how to use them by themselves, and in combination with the other programs. The authors are intimately familiar with the tips and tricks that can be used to create excellent scripts, as well as the traps that can make your best effort a bad shell script. With Classic Shell Scripting you'll avoid hours of wasted effort. You'll learn not only write useful shell scripts, but how to do it properly and portably.The ability to program and customize the shell quickly, reliably, and portably to get the best out of any individual system is an important skill for anyone operating and maintaining Unix or Linux systems. Classic Shell Scripting gives you everything you need to master these essential skills.

558 pages, Paperback

First published February 1, 2005

87 people are currently reading
490 people want to read

About the author

Arnold Robbins

38 books18 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
98 (34%)
4 stars
120 (42%)
3 stars
50 (17%)
2 stars
11 (3%)
1 star
3 (1%)
Displaying 1 - 15 of 15 reviews
Profile Image for Christopher.
1,409 reviews213 followers
June 3, 2014
By the time the last edition of O’Reilly’s Classic Shell Scripting was published in 2005, the approach it used was already somewhat out of date and the readership it addressed on the way out. The authors assumed that one is using any one of a number of old commercial versions of Unix, and might just be sharing a system with a number of other users, when nowadays most people doing anything with a Unix-style shell are probably running Linux on their own PCs.

However, don’t let that scare you away, because this book still has the potential to change your computing life forever. The authors’ careful and clear advice on using piped commands to build up scripts allows one to automate a great deal of one’s work away. Operations on text (which is potentially anything in a Unix-style system) that earlier may have taken me hours, now take minutes or seconds, and I’m a lot more confident in the output. Here are some random examples of things I’ve been able to quickly do in the last 24 hours thanks to this book:

* Search/replace a tag among the thousands of MP3 files in my collection in one go;
* Batch resize a collection of several dozen PDFs, producing two different output sizes for each document
* Rebuild a lost address book by extracting all phone numbers sent to me in e-mails and linking them to the names of the senders.

A Bash script, or simply interactively typing a series of commands at the command line, is a great solution for one-off jobs, as with an awareness of just a handful of small utilities you can move mountains, while using a more formal programming language like Python would be more time-consuming.

In its novice-intermediate portions, this book somewhat overlaps with O’Reilly’s Learning the Bash Shell, and in its advanced portions with Effective Awk Programming. Those other two books have the same now-antiquated approach, but all three books are still worth reading for a rigorous course in the Linux command line.

I do wish that O’Reilly would publish a newer edition. Besides writing something that speaks more directly to the needs of shell learners on single-user Linux installations, it would also be necessary to explain the subtle differences between Bash and Dash, as the latter has become the default script-running shell in many Linux distributions.
Profile Image for Ethan J.
356 reviews11 followers
June 10, 2019
A quick 1-hr read, worthwhile.
* interesting to learn about sed, will try to use it more often
* still not convinced to use awk
* had a better overview of writing programs in script, will try to use it more
* interesting to learn the checksum utilities, could be useful
* interesting utility binaries do not print chatty messages by design
* interesting to know ‘export -p’ to show all current env variables
79 reviews4 followers
April 29, 2021
Maybe it was a good book in 2005, but not as useful anymore. A lot of topics not relevant in 2021.

In other parts of book author use combination of shell scripting, sed and awk to do complex text processing and other things. Now almost everyone do this type of task with python, because it's a lot more capable, flexible and easier to update code later.

a lot of basic command line knowledge are lacking in this book, that you can find in newer books.
Profile Image for Tony Poerio.
212 reviews13 followers
June 3, 2017
Solid reference text with good coverage - basics of awk, sed, regex, and quick notes on most of the commonly used Unix commands. Also a few recipes and pipelines to mine for examples. Keep it on my desk.
2,072 reviews56 followers
December 31, 2018
I didn't find the organization that helpful. I was hoping for a book that I could keep as a reference whenever I had a task that could use shell scripting but I didn't see too many points I'd refer to.
Profile Image for Ricky Pruitt.
79 reviews1 follower
November 4, 2022
I've been reading this book off and on at work. This book has more value than I could ever need.
Profile Image for Vladislav Ivanishin.
8 reviews1 follower
August 7, 2016
For the most part the book is a remarkably easy read. Mainly for newbies but gives appropriate level of depth as well and certainly can serve as a good reference. All in all I think it's a successful embodiment of the "do one thing and do it well" principle the thing here being teaching the reader to use the Unix shell to their maximum advantage.

It's a great book if portability of shell scripts is your concern. Authors make clear distinction between the standard POSIX features, bash/ksh language extensions and non-standard (GNU/BSD/etc.) options to the Unix tools. It is actually very nice to know and makes much more sense then trying to read an online bash reference for example.

I liked the short command descriptions. Much easier to find relevant information than by combing through man pages (and marginally faster than googling for a StackOverflow answer). I keep this book handy.

Directly concerning the shell scripting skills is the first 1/3 of the book and the two chapters on awk. You can go off and be a shell ninja after reading just that. I've been using the command line for at least 3 years daily but only knew the very basics of shell scripting (and to be honest, detested "bash" because of it's unforgiving syntax). I love shell scripting now, it's making my life easier allowing to be a more productive developer. I know better now than using Python to automate little mundane things.

The book and especially the appendices can serve as a very gentle introduction to Unix.

Neither the book nor shell scripting is old (it is an old technology for sure, but it works splendidly and doesn't go out of style). If you you are not a confident shell user it's totally worth your time. If you use GNU/Linux or any other Unix system you should become a confident user of the shell.
Profile Image for Eric Farmer.
Author 1 book2 followers
July 13, 2014
Excellent read. I find myself reaching for it daily as a reference material. It has been quite useful with my day job. The author not only explains how various commands can fit neatly together to form powerful scripts, but also explains the history of various commands and even goes more in depth into how the POSIX standard came to be in its implementation into how specific commands behave.

This added insight helps in understanding not only how things work, but why they work the way they do. It also enables me to write my own scripts to the current standard while avoiding mistakes and pitfalls others have made in the past. As they say, "Those who forget the past are doomed to repeat it." This goes doubly for computer software.

I highly recommend this book to anyone that uses UNIX or Linux daily. Even if you aren't a programmer, you should learn how to use the command line. You can often get more done in less time. Often, it is faster to write your own script to perform a task than it is to spend hours surfing the web in search of that elusive program with a fancy GUI that does exactly what you want it to do.
Profile Image for Celso Crivelaro.
15 reviews4 followers
May 19, 2014
The best book I've read about Shell Script. This book contains topics from baby steps to advanced scripts used in production servers.

All topics are detailed with easy examples to be replicated in your own computer. For these characteristics, I strong recommend this book for who is working with operations and DevOps.
120 reviews18 followers
Want to read
February 11, 2021
This book is a great introduction to the Linux (or Unix) way of combining tools, each with a specific purpose, to carry out a variety of tasks. There are many examples that will help a beginner get up to speed. This is not, however, a book for learning how to use Linux in general.
Profile Image for Dan.
233 reviews
June 24, 2008
Great Reference material. Helps whenever I have to write a script.
Profile Image for Христо.
50 reviews
January 1, 2016
I'd wholeheartedly recommend the book to anyone involved or interested in portable scripting.
Profile Image for Dayton Outar.
113 reviews5 followers
January 3, 2023
Half of the book is really useful. I think after Chapter 7, there are a few more good ideas but it gets philosophical. I'm not sure if those ideas are classical.
Profile Image for Bart.
113 reviews
May 3, 2018

Shell scripting skills never go out of style. It's the shell that unlocks the real potential of Unix. Shell scripting is essential for Unix users and system administrators-a way to quickly harness and customize the full power of any Unix system. With shell scripts, you can combine the fundamental Unix text and file processing commands to crunch data and automate repetitive tasks. But beneath this simple promise lies a treacherous ocean of variations in Unix commands and standards. Classic Shell Scripting is written to help you reliably navigate these tricky waters.


Writing shell scripts requires more than just a knowledge of the shell language, it also requires familiarity with the individual Unix programs: why each one is there, how to use them by themselves, and in combination with the other programs. The authors are intimately familiar with the tips and tricks that can be used to create excellent scripts, as well as the traps that can make your best effort a bad shell script. With Classic Shell Scripting you'll avoid hours of wasted effort. You'll learn not only write useful shell scripts, but how to do it properly and portably.


The ability to program and customize the shell quickly, reliably, and portably to get the best out of any individual system is an important skill for anyone operating and maintaining Unix or Linux systems. Classic Shell Scripting gives you everything you need to master these essential skills.

Displaying 1 - 15 of 15 reviews

Can't find what you're looking for?

Get help and learn more about the design.