Slashdot Mirror


Unix Shell Programming, Third Edition

honestpuck writes "Back when dinosaurs roamed the earth and NCR made Unix computers I first started to program for a living. Back then when someone said 'script' they meant a shell script, generally for a Bourne shell." Even if the definition of "scripting" has grown somewhat, honestpuck argues, the old meaning still has merit and use. Read on for his review of the latest edition of Unix Shell Programming. Unix Shell Programming, Third Edition author Stephen G. Kochan and Patrick Wood pages 406 publisher SAMS rating 8 - Well written, good topic coverage, some small flaws reviewer Tony Williams ISBN 0672324903 summary Good introduction to shell programming and using the shell

Now that we have languages such as Perl and Python, much of shell scripting has been forgotten. The need still arises for the times and places where running Perl would be just that little bit too much overhead; cron jobs, process start and stop scripts, even machine start and stop scripts. For these we could best go back to the old ways. Combining the power of the common Unix tools, pipes and scripts in a fairly obscure and slightly arcane syntax is not easy to pick up, though the language's simplicity does, in some ways, make it easier than more complex ones such as Perl. This book does a good job at introducing shell programming and I found it an excellent book when I needed a refresher.

I don't want to sell this volume short: you won't just learn about shell programming. The first ninety or so pages provide an excellent guide to getting the best out of the shell, and the last chapter is devoted to the features specific to an interactive shell such as command-line editing and using the history.

The authors have chosen to use the POSIX standard Bourne shell ('bash', available on many *nix systems, is a superset of the POSIX standard). That seems the right decision, given that it is so universally available and usually the default shell.

The book is well structured, starting out with a brief look at *nix operating systems before introducing the shell followed by some basic tools; cut, paste, sed, tr, grep, sort and uniq. One minor quibble, the book explains how to redirect STDOUT to a file and STDERR to a file, but not how to redirect both to the same file. That aside, these few chapters provide a good introduction to the shell.

The text goes on to systematically explore shell programming starting with variables and arithmetic. The chapters are kept short, in a good order and have a number of exercises at the end of each. The structure of the book and the order each new concept is introduced is well thought out; at each stage small examples are given that only use material already introduced and are complete in performing a task. In early chapters they are fairly trivial but by the end there is a fairly complete rolodex program written in shell script that would be a good model for anything you wished to do.

There is also a good summary of the shell syntax and common commands in Appendix A and good 'Further Information' in Appendix B. Kudos must go to the authors for a list of books for further reading that is not ashamed of mentioning other publishers, indeed they say "One of the best sources of books on Unix-related topics is O'Reilly and Associates" and list volumes from them before mentioning their own publishers.

There are some small typographic errors in the text but I did not find any in the script examples I tried. I found it to be well written and readable throughout, perhaps an advantage of a third edition in a slow moving technology.

You can visit the Sams web page devoted to the book which has the Table of Contents and the third chapter available for download. It has no errata or source code, I looked to see if the authors maintained a site for the book but could not find one.

I would recommend everyone read this book once or twice, it provides a comprehensive, well written tutorial on one of the most basic (and often overlooked) tools at your disposal. Even Windows users could install Cygwin and gain the benefit of a good POSIX compliant shell and this book. It also has the advantage that once purchased it will be useful for many, many years to come - the language has not changed noticeably in twenty five years and should not change in another twenty five.

You can purchase Unix Shell Programming, Third Edition from bn.com. Slashdot welcomes readers' book reviews -- to submit a review for consideration, read the book review guidelines, then visit the submission page.

12 of 292 comments (clear)

  1. planet/population rescue, gnu millennium edition? by Anonymous Coward · · Score: -1, Offtopic

    no need to wrap it, just put it on the kharm(a).

    making the case that the won-eyed girl is a phonIE (mynuts won, beating a lame won to debt?)
    by Anonymous Coward on Wednesday December 31, @06:48AM (#7844071)

    will corepirate nazi felon ?pr? ?firm? scriptdead execrable (mynuts won, it's ok if you do it for monIE?)
    by Anonymous Coward on Wednesday December 31, @06:44AM (#7844061)
    skew/FUDge survey results/EVERYTHING?

    you can bet your .asp again on that won. fortunately we have robbIE's 'stuff that matters' slowgun, & his gnu dating service to keep US abreast of reality/prevent softwar gangster hypenosys mindphuking?

    &, failing that, we have the:

    pateNTdead eyecon0meter used to .controll ?pr? ?firm? crap? (mynuts won, need a date buddIE?)
    by Anonymous Coward on Tuesday December 30, @02:38PM (#7837849)
    that's right. this stuff is unbreakable, & wwworks on several (more than 3) dimensions.

    morons build vessel that floats on any suBStance? (mynuts won, no need to be suspicious?)
    by Anonymous Coward on Monday December 29, @02:53PM (#7829639)
    you can bet your .asp on that won?

    creators/humankind converge to repel unprecedented evile? (mynuts won, who run our 'banks'?)
    by Anonymous Coward on Monday December 29, @02:51PM (#7829610)

    & why not? what other options are there for us?

    eyecon0meter: survival most sought after feature? (mynuts won, get yOUR freedumb here?)
    by Anonymous Coward on Monday December 29, @02:48PM (#7829586)

    creators' badtoll over corepirate nazi execrable (mynuts won, many think hangin's way too good for the skalywags?)
    by Anonymous Coward on Monday December 29, @02:46PM (#7829567)
    disposal?

    newclear power dissed/cussed? (mynuts won, no animals killed buy MiStake in newclear power generation)
    by Anonymous Coward on Monday December 29, @02:41PM (#7829536)
    &, it's free as in free.

    newclear powered blips explore corepirate nazi (mynuts won, no lowrating robbIE's sponsors?)
    by Anonymous Coward on Monday December 29, @07:53AM (#7826913)
    cesspool?

    pheWWW.

    lookout bullow. the daze of the phonIE payper liesense ?pr? ?firm? hypenosys stock markup FraUD softwar gangster execrable, is WANing into coolapps/the abyss, at the increasing speed of right.

    consult with/trust in yOUR creators.... get ready to brighten up?

    mynuts won: solar(is) power included?

  2. Windows 2003 has some K-RAD new scripting! by slash-tard · · Score: -1, Offtopic

    Watch out GNU/perl and GNU/linux!

  3. wtf is up with this RACISM? by Anonymous Coward · · Score: -1, Offtopic

    wow, I went to CowboyNeal's home page and what do I see?

    Blatant use of the N-word!

    As an african-american, I find this racial intolerance to be intolerable and will not support a site that employs racists in its ranks.

    You should be ashamed of yourselevs.

    1. Re:wtf is up with this RACISM? by Anonymous Coward · · Score: -1, Offtopic

      So I haven't posted in the past couple weeks, because the time I used to waste updating this waste of time has been spend dealing with spammers and scripters who are either convinced I'm a flaming homosexual or that gay niggers should bind together in some sort of organization. At any rate, I just don't care, and I don't want to spend my time on it, so from now on, there's no comments. If you got something to say, email me, unless it relates to the groups I mentioned above, then don't bother me. Instead try talking to real people, like girls. They smell nice and are nice to be around, almost like evolution made it that way.

      I'm not sure what I'm gonna do with my old entries, since movabletype doesn't seem to allow me to turn comments off on them, so they might be all deleted in the not-too-distant future. Sucks, doesn't it? That's why one shouldn't go pissing in the pool!

      Anyway, enough wasting time on this place. It is the middle of the day and I have a real job that pays money to worry about. Thanks for wasting my break from work, fuckers, and you know who you are.

    2. Re:wtf is up with this RACISM? by Anonymous Coward · · Score: -1, Offtopic

      he just likes black people because they remind him of chocolate.

    3. Re:wtf is up with this RACISM? by Anonymous Coward · · Score: -1, Offtopic

      um, it is never right to use such a word that has such a historical meaning of racism, prejudice, oppression, and death.

      I am sorry, but racism is intolerable in all forms.

    4. Re:wtf is up with this RACISM? by Anonymous Coward · · Score: -1, Offtopic

      who ever said my comment was offtopic is a racist too.

      i think this is an important issue and if you do not want to discuss it, then I understand just what kind of people you are and how you are not interested in removing all forms of racism from the world

  4. Kochan, Wood by Anonymous Coward · · Score: -1, Offtopic

    Am I the only one snickering at these names?

    "Kochan Wood, Kochan Wood..."

  5. mynuts won, stuff that really matters is...? by Anonymous Coward · · Score: -1, Offtopic

    online dating? fauxking phonIE payper liesense gadgetry?

    the upcoming va lairIE/robbIE answer yOUR questions about stock markup FraUD/# juggling interview should clear things up a bit?

    when too much corepirate nazi puppet sucksass is never enough?

  6. YOU DIRTY RACIST! by Anonymous Coward · · Score: -1, Offtopic

    you used the N-word again!

    I'm effin mad now. I'm not ever coming back to this racist website

  7. Eunuch's Shell? by Anonymous Coward · · Score: -1, Offtopic

    What is a Eunuch's shell?

  8. I Must Put the Question to You Again... by Anonymous Coward · · Score: -1, Offtopic

    ...sirs. What the fuck does "honstepuck" (pronounced hon-ste-puk) mean? It sounds like some kind of German slang for some nasty sexual act. I don't understand where some of these Slashdot droids get their names from. It makes no sense at all. I would understand a name like "Neo" or "AgentSmith" or "Tenchi" or "PukeSkywalker" or "Trolling4Dollars" or "Deckard" or "TomServo" or "LilKim" or "TonyaHarding" or "BitchInHeat" or "SexyGal$$$" or "SUBJECT LINE TROLL" or "EliseSutton" or "Diva" or "Gomiller61" or even "Bob". But "honstepuck"? Why?

    Please don't mod this down. It's a serious question and I've asked it a few times before. For some incomprehensible reason, people seem to feel the need to mod this questions down. But fight the urge and mod it up so that I may finally rest with a decent answer that someone in the know may provide.

    Thank You Sirs,
    EelsFuckingInaBucketOfSnot

    To my Jihad brothers... PROPS!