12.07.2015 Views

Advanced Bash-Scripting Guide

Advanced Bash-Scripting Guide

Advanced Bash-Scripting Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Advanced</strong> <strong>Bash</strong>-<strong>Scripting</strong> <strong>Guide</strong>Table of ContentsChapter 21. Restricted Shells.........................................................................................................................359Chapter 22. Process Substitution...................................................................................................................361Chapter 23. Functions....................................................................................................................................36423.1. Complex Functions and Function Complexities.........................................................................36723.2. Local Variables...........................................................................................................................37723.2.1. Local variables and recursion...........................................................................................37823.3. Recursion Without Local Variables............................................................................................380Chapter 24. Aliases.........................................................................................................................................383Chapter 25. List Constructs...........................................................................................................................386Chapter 26. Arrays.........................................................................................................................................389Chapter 27. /dev and /proc.............................................................................................................................41727.1. /dev..............................................................................................................................................41727.2. /proc............................................................................................................................................419Chapter 28. Of Zeros and Nulls.....................................................................................................................425Chapter 29. Debugging...................................................................................................................................429Chapter 30. Options........................................................................................................................................439Chapter 31. Gotchas.......................................................................................................................................441Chapter 32. <strong>Scripting</strong> With Style..................................................................................................................44932.1. Unofficial Shell <strong>Scripting</strong> Stylesheet..........................................................................................449Chapter 33. Miscellany...................................................................................................................................45233.1. Interactive and non-interactive shells and scripts.......................................................................45233.2. Operator Precedence...................................................................................................................45333.3. Shell Wrappers............................................................................................................................45533.4. Tests and Comparisons: Alternatives..........................................................................................46033.5. A script calling itself (recursion)................................................................................................46033.6. "Colorizing" Scripts....................................................................................................................46333.7. Optimizations..............................................................................................................................47533.8. Assorted Tips..............................................................................................................................47633.8.1. Ideas for more powerful scripts.........................................................................................47633.8.2. Widgets..............................................................................................................................48533.9. Security Issues............................................................................................................................48733.9.1. Infected Shell Scripts.........................................................................................................48733.9.2. Hiding Shell Script Source................................................................................................48733.9.3. Writing Secure Shell Scripts.............................................................................................48833.10. Portability Issues.......................................................................................................................48833.11. Shell <strong>Scripting</strong> Under Windows...............................................................................................489iii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!