From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,2e3e0c813d725936,start X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 2002-04-01 12:55:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!sn-xit-01!supernews.com!news.alt.net!cola.stump.algebra.com!robomod!not-for-mail From: "M. Leo Cooper" Newsgroups: comp.os.linux.announce Subject: Advanced Bash Scripting Guide - version 1.2 update Date: Mon, 1 Apr 2002 14:53:45 CST Organization: Altopia Corp. - Usenet Access - http://www.altopia.com Message-ID: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-Path: X-COLA-Policy: http://stump.algebra.com/~cola X-COLA-Info-1: Send submissions to cola@stump.algebra.com X-COLA-Info-2: Send complaints to cola-admin@stump.algebra.com X-Comment: moderators do not necessarily agree or disagree with this article. X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-X-Sender: X-Auth: PGPMoose V1.1 PGP comp.os.linux.announce iQBVAwUAPKjI2SFvAtx2nXvNAQFKRgIArkzpspUDQjJjzmv/I6MbjZqDIkZilwl0 gy9A3+RxEo0w9llunVY0kOJjyrUcZ6L/JF93DcMJhUM18UGtkBS3rg== =MeiJ Xref: archiver1.google.com comp.os.linux.announce:1946 Announcing the release of the version 1.2 update of the "Advanced Bash Scripting Guide". This LDP-hosted project is a complete tutorial and reference on the gentle art of shell scripting under Linux and generic UNIX. This is the equivalent of a 460-page printed book, and it's free and freely distributable. >>From the introduction: This tutorial assumes no previous knowledge of scripting or programming, but progresses rapidly toward an intermediate/advanced level of instruction (...all the while sneaking in little snippets of UNIX wisdom and lore). It serves as a textbook, a manual for self-study, and a reference and source of knowledge on shell scripting techniques. The exercises and heavily-commented examples invite active reader participation, under the premise that the only way to really learn scripting is to write scripts. Table of Contents: Part 1. Introduction 1. Why Shell Programming? 2. Starting Off With a Sha-Bang 2.1. Invoking the script 2.2. Preliminary Exercises Part 2. Basics 3. Exit and Exit Status 4. Special Characters 5. Introduction to Variables and Parameters 5.1. Variable Substitution 5.2. Variable Assignment 5.3. Bash Variables Are Untyped 5.4. Special Variable Types 6. Quoting 7. Tests 7.1. Test Constructs 7.2. File test operators 7.3. Comparison operators (binary) 7.4. Nested if/then Condition Tests 7.5. Testing Your Knowledge of Tests 8. Operations and Related Topics 8.1. Operators 8.2. Numerical Constants Part 3. Beyond the Basics 9. Variables Revisited 9.1. Internal Variables 9.2. Manipulating Strings 9.3. Parameter Substitution 9.4. Typing variables: declare or typeset 9.5. Indirect References to Variables 9.6. $RANDOM: generate random integer 9.7. The Double Parentheses Construct 10. Loops and Branches 10.1. Loops 10.2. Nested Loops 10.3. Loop Control 10.4. Testing and Branching 11. Internal Commands and Builtins 11.1. Job Control Commands 12. External Filters, Programs and Commands 12.1. Basic Commands 12.2. Complex Commands 12.3. Time / Date Commands 12.4. Text Processing Commands 12.5. File and Archiving Commands 12.6. Communications Commands 12.7. Terminal Control Commands 12.8. Math Commands 12.9. Miscellaneous Commands 13. System and Administrative Commands 14. Command Substitution 15. Arithmetic Expansion 16. I/O Redirection 16.1. Using exec 16.2. Redirecting Code Blocks 16.3. Applications 17. Here Documents 18. Recess Time Part 4. Advanced Topics 19. Regular Expressions 19.1. A Brief Introduction to Regular Expressions 19.2. Globbing 20. Subshells 21. Restricted Shells 22. Process Substitution 23. Functions 23.1. Complex Functions and Function Complexities 23.2. Local Variables 24. Aliases 25. List Constructs 26. Arrays 27. Files 28. /dev and /proc 28.1. /dev 28.2. /proc 29. Of Zeros and Nulls 30. Debugging 31. Options 32. Gotchas 33. Scripting With Style 33.1. Unofficial Shell Scripting Stylesheet 34. Miscellany 34.1. Interactive and non-interactive shells and scripts 34.2. Shell Wrappers 34.3. Tests and Comparisons: Alternatives 34.4. Optimizations 34.5. Assorted Tips 34.6. Oddities 34.7. Portability Issues 34.8. Shell Scripting Under Windows 35. Bash, version 2 36. Endnotes 36.1. Author's Note 36.2. About the Author 36.3. Tools Used to Produce This Book 36.3.1. Hardware 36.3.2. Software and Printware 36.4. Credits Bibliography A. Contributed Scripts B. A Sed and Awk Micro-Primer B.1. Sed B.2. Awk C. Exit Codes With Special Meanings D. A Detailed Introduction to I/O and I/O Redirection E. Localization F. History Commands G. A Sample .bashrc File H. Converting DOS Batch Files to Shell Scripts I. Exercises I.1. Analyzing Scripts I.2. Writing Scripts ===================================== URLs: From the Linux Documentation site: http://www.linuxdoc.org/LDP/abs/html/ http://www.linuxdoc.org/guides.html#abs From the author's home site: http://personal.riverusers.com/~thegrendel/abs-guide-1.2.tar.gz [526 k] (complete tarball including SGML/Docbook source, all example scripts, and rendered HTML). ########################################################################## # Send submissions for comp.os.linux.announce to: cola@stump.algebra.com # # PLEASE remember a short description of the software and the LOCATION. # # This group is archived at http://stump.algebra.com/~cola/ # ##########################################################################