At 260 pages, Apple's Shell Scripting Primer is really more of a book than a guide. Originally published in 2006 and updated as recently as last month, it is available as a PDF and is accompanied by a zipped file of sample scripts. Chapters include:
| Chapter 1 | Before You Begin |
| Chapter 2 | Shell Script Basics |
| Chapter 3 | Shell Input and Output |
| Chapter 4 | Flow Control, Expansion, and Parsing |
| Chapter 5 | Result Codes, Chaining, and Flags |
| Chapter 6 | Subroutines, Scoping, and Sourcing |
| Chapter 7 | Paint by Numbers |
| Chapter 8 | Regular Expressions Unfettered |
| Chapter 9 | How AWK-ward |
| Chapter 10 | Designing Scripts for Cross-Platform Deployment |
| Chapter 11 | Advanced Techniques |
| Chapter 12 | Performance Tuning |
| Chapter 13 | Shell Script Security |
| Appendix A | Special Shell Variables |
| Appendix B | Other Tools and Information |
| Appendix C | Starting Points |
| Appendix D | An Extreme Example: The Monte Carlo (Bourne) Method for Pi |
| Appendix E | Historical Footnotes and Arcana |
/nix | Jul 14, 2011