Shell Programming in Unix, Linux and OSX, 4th Ed

 Authors: Stephen G. Kochan & Patrick Wood 
Publisher: Addison-Wesley
Pages: 456 
ISBN: 978-0134496009
Print: 0134496000
Kindle: B01L480ILM
Audience: Beginners
Rating: 4
Reviewer: Mike James 

 

With even Windows offering a Linux shell, this is a good time to learn this language.

Unfortunately the Linux shell is very idosyncratic, and hence a difficult language to master. There are few general principles behind it and those that there are are difficult to notice and difficult to interpret. This book is reasonably good at pointing out some of the basic principles of how the Shell works, but it is also packed with a lot of detail that you could just as easily look up on the web.

The first chapter is more like a tutorial on command line Linux - using ls, cat, cp, mv and rm to work with files and mkdir and rmdir to work with directories.  It also covers pipes, filters and the standard I/O channels.  All of this is useful even without Shell programming and it represents what the average Linux users should already know.

The second chapter introduces the Shell proper and if you already know basic command line Linux this is the place to start. In this chapter we learn what the Shell is and basic ideas such as variables and wild characters are introduced. All fairly easy, which can't be said for the next chapter which deals with regular expressions. This subject is difficult and probably best left till later in the book.

  

 

Chapter 4 goes over variables and expressions in detail. Chapter 5 is all about the use of different types of quote marks and the general complexities of strings in the Shell. Chapter 6 deals with the strange ways of passing parameters to Shell scripts and uses an example of a phone book program. This is interesting but I would urge anyone considering writing this sort of thing not to use the Shell but a proper programming language. 

Next we look at the way that you can use conditionals in Chapter 7 and how to implement loops in Chapter 8. These are both big topics and difficult to master if you are a novice programmer. They are taken very slowly in this book and if you are already a programmer in another language you might do better with a faster-paced approach. 

Chapter 9 is about I/O and working with files. Chapter 10 is about environment variables and some more on the general Shell environment. Chapters 11 and 12 deal with some advanced topics, including more advanced ways of working with parameters and the eval command and functions. Chapter 13 is a case study, returning to the phone book program, and again I feel that it would be better written in another language. The final chapter gathers together some nonstandard shell features. 

Overall this is a slowish introduction to Shell programming that would suit the very nearly complete beginner. It does take you from the simplest of Linux commands to some quite complicated ideas. However, Shell scripts are mostly used for admin tasks and here the book is less helpful. Writing a script that implements a phone directory serves to show off some of the techniques, but it doesn't equip you to deal with modifying and checking access permissions, maintaining users, checking logs and so on. The problem is that learning Shell scripting is just the start of the problem that you are trying to solve. The first time you need to run a program every day at 12am you will have to tackle cron, which is not covered in the book. 

The final verdict has to be that this is quite a good general, but slow, introduction to Shell scripting and if you are going to graduate to doing really useful things with it you will need a follow-on book. If you program in any other language then you need a more advanced and faster -paced book to start with. 

Reviews of other books by Stephen Kochan from Addison-Wesley

Programming in Objective-C, 3rd Ed 

 Programming in C, 4th Ed

 

 

To keep up with our coverage of books for programmers, follow @bookwatchiprog on Twitter or subscribe to I Programmer's Books RSS feed for each day's new addition to Book Watch and for new reviews.

Banner


Data Structures & Algorithms in Python

Author: Dr. John Canning, Alan Broder and Robert Lafore
Publisher: Addison-Wesley
Date: October 2022
Pages: 928
ISBN:978-0134855684
Print: 013485568X
Kindle: B0B1WJF1K9
Audience: Python developers
Rating: 4
Reviewer: Mike James
Data structures in Python - a good idea!



Python Programming with Design Patterns

Author: James W. Cooper
Publisher: Addison-Wesley
Date: February 2022
Pages: 352
ISBN: 978-0137579938
Print: 0137579934
Kindle: B09D2RKQB5
Audience: Python developers
Rating: 1
Reviewer: Mike James
There was a time that design patterns were all the thing. Not so much now. But Python - does it have [ ... ]


More Reviews

Last Updated ( Tuesday, 22 November 2016 )