Cari di Shell Script 
    Shell Script Linux Reference Manual
Daftar Isi
(Sebelumnya) 37. Bash, versions 2, 3, and 4 ...Bibliography (Berikutnya)

38.1. Author's Note

 

doce ut discas

(Teach, that you yourself may learn.)

How did I come to write a scripting book? It's a strangetale. It seems that a few years back I needed to learnshell scripting -- and what better way to do that than to read agood book on the subject? I was looking to buy a tutorial andreference covering all aspects of the subject. I was looking for abook that would take difficult concepts, turn them inside out, andexplain them in excruciating detail, with well-commented examples. [1]In fact, I was looking for this very book,or something very much like it. Unfortunately, it didn't exist, and if I wanted it,I'd have to write it. And so, here we are, folks.

That reminds me of the apocryphal story about a mad professor. Crazy as a loon, the fellow was. At the sight of a book, any book -- at the library, at a bookstore, anywhere -- he would become totally obsessed with the idea that he could have written it, should have written it -- and done a better job of it to boot. He would thereupon rush home and proceed to do just that, write a book with the very same title. When he died some years later, he allegedly had several thousand books to his credit, probably putting even Asimov to shame. The books might not have been any good, who knows, but does that really matter? Here's a fellow who lived his dream, even if he was obsessed by it, driven by it . . . and somehow I can't help admiring the old coot.

Notes

[1]

This is the notorious flog it to death technique that works so well with slow learners, eccentrics, odd ducks, fools and geniuses.


38.2. About the Author

Who is this guy anyhow?

The author claims no credentials or special qualifications, [1]other than a compulsion to write. [2]

This book is somewhat of a departure from his other major work,HOW-2 Meet Women: The Shy Man's Guide toRelationships. He has also written the Software-BuildingHOWTO. Of late, he has been trying his(heavy) hand at fiction: Dave DawsonOver Berlin (excerpt). He also has a fewInstructables (here,here,here,andhereto his (dis)credit.

A Linux user since 1995 (Slackware 2.2, kernel 1.2.1),the author has emitted a fewsoftware truffles, including the cruftone-time pad encryption utility, the mcalcmortgage calculator, the judgeScrabble� adjudicator, the yawlword gaming list package, and the Quackyanagramming gaming package. He got off to a rather shaky start in thecomputer game -- programming FORTRAN IV on a CDC 3800 (on paper codingpads, with occasional forays on a keypunch machine and a FridenFlexowriter) -- and is not the least bit nostalgic for thosedays.

Living in an out-of-the-way community with wife and orange tabby, he cherishes human frailty, especially his own. [3]

Notes

[1]

In fact, he has no credentials or special qualifications. He's a school dropout with no formal credentials or professional experience whatsoever. None. Zero. Nada. Aside from the ABS Guide, his major claim to fame is a First Place in the sack race at the Colfax Elementary School Field Day in June, 1958.

[2]

Those who can, do. Those who can't . . . get an MCSE.

[3]

Sometimes it seems as if he has spent his entire life flouting conventional wisdom and defying the sonorous Voice of Authority: "Hey, you can't do that!"


38.3. Where to Go For Help

The author will infrequently, if not too busy (and in a good mood), answer general scripting questions. [1] If you have a problem getting a particular script to work, you would be well advised to post to the comp.os.unix.shell Usenet newsgroup.

 

... sophisticated in mechanism but possibly agileoperating under noises being extremely suppressed ...

--CI-300 printer manual

Notes

[1]

E-mails from certain spam-infested TLDs (61, 202, 211, 218, 220, etc.) will be trapped by spam filters and deleted unread.

[2]

Well, if you absolutely insist, you can try modifying Example A-44 to suit your purposes.


38.4. Tools Used to Produce This Book

38.4.1. Hardware

A used IBM Thinkpad, model 760XL laptop (P166, 104 meg RAM) running Red Hat 7.1/7.3. Sure, it's slow and has a funky keyboard, but it beats the heck out of a No. 2 pencil and a Big Chief tablet.

Update: upgraded to a 770Z Thinkpad (P2-366, 192 meg RAM) running FC3. Anyone feel like donating a later-model laptop to a starving writer <g>?

Update: upgraded to a T60 Thinkpad running Mandriva 2010. No longer starving <g>.

38.4.2. Software and Printware

  • Bram Moolenaar's powerful SGML-aware vim text editor.

  • OpenJade,a DSSSL rendering engine for converting SGML documents into otherformats.

  • NormanWalsh's DSSSL stylesheets.

  • DocBook, The Definitive Guide, by Norman Walsh and Leonard Muellner (O'Reilly, ISBN 1-56592-580-7). This is still the standard reference for anyone attempting to write a document in Docbook SGML format.


  • 38.5. Credits

    Community participation made this project possible. The author gratefully acknowledges thatwriting this book would have been unthinkable withouthelp and feedback from all you people out there.

    Philippe Martintranslated the first version (0.1) of this document intoDocBook/SGML. While not on the job at a small French company as asoftware developer, he enjoys working on GNU/Linux documentationand software, reading literature, playing music, and, for hispeace of mind, making merry with friends. You may run across himsomewhere in France or in the Basque Country, or you can email himat [email protected].

    Philippe Martin also pointed out that positional parameterspast $9 are possible using {bracket} notation. (See Example 4-5).

    St�phaneChazelas sent a long list of corrections, additions,and example scripts. More than a contributor, he had, in effect,for a while taken on the role of co-editorfor this document. Mercibeaucoup!

    Paulo Marcel Coelho Aragao offered many corrections, both major and minor, and contributed quite a number of helpful suggestions.

    I would like to especially thank Patrick Callahan, Mike Novak, and Pal Domokos for catching bugs, pointing out ambiguities, and for suggesting clarifications and changes in thepreliminary version (0.1) of this document. Their livelydiscussion of shell scripting and general documentation issuesinspired me to try to make this document more readable.

    I'm grateful to Jim Van Zandt for pointing out errors and omissions in version 0.2 of this document. He also contributed an instructive example script.

    Many thanks to Jordi Sanfeliu for giving permission to use his fine tree script (Example A-16), and to Rick Boivie for revising it.

    Likewise, thanks to Michel Charpentier forpermission to use his dc factoring script(Example 16-52).

    Kudos to Noah Friedman for permission to use his string function script (Example A-18).

    Emmanuel Rouat suggested corrections and additions on command substitution, aliases, and path management. He also contributed a very nice sample .bashrc file (Appendix M).

    Heiner Stevenkindly gave permission to use his base conversion script, Example 16-48. He also made a number of corrections and manyhelpful suggestions. Special thanks.

    Rick Boivie contributed the delightfully recursivepb.sh script (Example 36-9),revised the tree.sh script (Example A-16), and suggested performance improvementsfor the monthlypmt.sh script (Example 16-47).

    Florian Wisser enlightened me on some of the fine points oftesting strings (see Example 7-6), and on othermatters.

    Oleg Philon sent suggestions concerning cut and pidof.

    Michael Zick extended the emptyarray example to demonstrate some surprising arrayproperties. He also contributed the isspammerscripts (Example 16-41 and Example A-28).

    Marc-Jano Knopp sent corrections and clarifications on DOS batch files.

    Hyun Jin Cha found several typos in the document in the process of doing a Korean translation. Thanks for pointing these out.

    Andreas Abraham sent in a long list of typographicalerrors and other corrections. Special thanks!

    Others contributing scripts, making helpful suggestions, andpointing out errors were Gabor Kiss, Leopold Toetsch,Peter Tillier, Marcus Berglof, Tony Richardson, Nick Drage(script ideas!), Rich Bartell, Jess Thrysoee, Adam Lazur, BramMoolenaar, Baris Cicek, Greg Keraunen, Keith Matthews, SandroMagi, Albert Reiner, Dim Segebart, Rory Winston, Lee Bigelow,Wayne Pollock, "jipe," "bojster,""nyal," "Hobbit," "Ender,""Little Monster" (Alexis), "Mark,""Patsie," "vladz," Peggy Russell,Emilio Conti, Ian. D. Allen, Hans-Joerg Diers, Arun Giridhar,Dennis Leeuw, Dan Jacobson, Aurelio Marinho Jargas, EdwardScholtz, Jean Helou, Chris Martin, Lee Maschmeyer, Bruno Haible,Wilbert Berendsen, Sebastien Godard, Bj�n Eriksson, JohnMacDonald, John Lange, Joshua Tschida, Troy Engel, ManfredSchwarb, Amit Singh, Bill Gradwohl, E. Choroba, David Lombard,Jason Parker, Steve Parker, Bruce W. Clare, William Park, VerniaDamiano, Mihai Maties, Mark Alexander, Jeremy Impson, Ken Fuchs,Jared Martin, Frank Wang, Sylvain Fourmanoit, Matthew Sage,Matthew Walker, Kenny Stauffer, Filip Moritz, Andrzej Stefanski,Daniel Albers, Jeffrey Haemer, Stefano Palmeri, Nils Radtke,Sigurd Solaas, Serghey Rodin, Jeroen Domburg, Alfredo Pironti,Phil Braham, Bruno de Oliveira Schneider, Stefano Falsetto,Chris Morgan, Walter Dnes, Linc Fessenden, Michael Iatrou, PharisMonalo, Jesse Gough, Fabian Kreutz, Mark Norman, Harald Koenig,Dan Stromberg, Peter Knowles, Francisco Lobo, Mariusz Gniazdowski,Sebastian Arming, Chetankumar Phulpagare, Benno Schulenberg,Tedman Eng, Jochen DeSmet, Juan Nicolas Ruiz, Oliver Beckstein,Achmed Darwish, Dotan Barak, Richard Neill, Albert Siersema,Omair Eshkenazi, Geoff Lee, Graham Ewart, JuanJo Ciarlante,Cliff Bamford, Nathan Coulter, Ramses Rodriguez Martinez,Evgeniy Ivanov, Craig Barnes, George Dimitriu, Kevin LeBlanc,Antonio Macchi, Tomas Pospisek, David Wheeler, Andreas K�hne,P�draig Brady, Joseph Steinhauser, and David Lawyer(himself an author of four HOWTOs).

    My gratitude to ChetRamey and Brian Fox for writing Bash,and building into it elegant and powerful scriptingcapabilities rivaling those of ksh.

    Very special thanks to the hard-working volunteers atthe Linux DocumentationProject. The LDP hosts a repository of Linux knowledgeand lore, and has, to a great extent, enabled the publicationof this book.

    Thanks and appreciation to IBM, Red Hat, Google, the Free Software Foundation, and all the good people fighting the good fight to keep Open Source software free and open.

    Belated thanks to my fourth grade teacher, Miss Spencer, for emotional support and for convincing me that maybe, just maybe I wasn't a total loss.

    Thanks most of all to my wife, Anita, for her encouragement, inspiration, and emotional support.


    38.6. Disclaimer

    (This is a variant of the standard LDP disclaimer.)

    No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors, omissions, and inaccuraciesthat could cause you to lose data, harm your system, or induceinvoluntary electrocution, so proceed with appropriatecaution. The author takes no responsibility for anydamages, incidental or otherwise.

    As it happens, it is highly unlikely that either you or your system will suffer ill effects, aside from uncontrollablehiccups. In fact, the raisond'etre of this book is to enable its readersto analyze shell scripts and determine whether they have unanticipated consequences.


    Copyright © 2000, by Mendel Cooper <[email protected]>
    (Sebelumnya) 37. Bash, versions 2, 3, and 4 ...Bibliography (Berikutnya)