1.1. Shell Commands1.1.1. echo1.1.2. printf1.1.3. set1.1.4. shift1.1.5. type1.1.6. getopts1.1.7. case1.1.8. eval1.1.9. local1.2. Parameters and Variables1.2.1. Positional Parameters1.2.2. Special Parameters1.2.3. standard-vars—A Collection of Useful Variables1.3. Patterns1.3.1. Pathname Expansion1.3.2. Regular Expressions1.4. Parameter Expansion1.4.1. The Bourne Shell Expansions1.4.2. POSIX Parameter Expansions1.4.3. Shell-Specific Expansions, bash2, and ksh931.5. Shell Arithmetic1.6. Aliases1.7. Sourcing a File1.8. Functions1.8.1. Functions Are Fast1.8.2. Command Substitution Is Slow1.8.3. Using the Functions in This Book1.9. standard-funcs: A Collection of Useful Commands1.9.1. get_key—Get a Single Keystroke from the User1.9.2. getline—Prompt User to Enter a Line1.9.3. press_any_key—Prompt for a Single Keypress1.9.4. menu1—Print a Menu and Execute a Selected Command1.9.5. arg—Prompt for Required Argument If None Supplied1.9.6. die—Print Error Message and Exit with Error Status1.9.7. show_date—Display Date in D[D] MMM YYYY Format1.9.8. date_vars—Set Date and Time Variables1.9.9. is_num—Is This a Positive Integer?1.9.10. abbrev_num—Abbreviate Large Numbers1.9.11. commas—Add Thousands Separators to a Number1.9.12. pr1—Print Arguments, One to a Line1.9.13. checkdirs—Check for Directories; Create If Necessary1.9.14. checkfiles—Check That a Directory Contains Certain Files1.9.15. zpad—Pad a Number with Leading Zeroes1.9.16. cleanup—Remove Temporary Files and Reset Terminal on Exit1.10. The Unix Utilities1.10.1. cat: Concatenate Files to the Standard Output1.10.2. sed: A Text Stream Editor1.10.3. awk: Pattern Scanning and Processing Language1.10.4. grep: Print Lines Matching a Regular Expression1.10.5. date: Show or Set the System Date1.10.6. tr: A Character Translation Utility1.10.7. wc: Count Characters, Words, and Lines in a File1.10.8. file: Determine the File Type1.10.9. ls: Sort and Provide Details About Files1.10.10. uniq: Remove Consecutive Duplicate Lines1.10.11. sudo: Execute Commands as the Superuser1.10.12. split: Divide a File into Equal-Sized Pieces1.10.13. which: Show the Full Path to a Command1.10.14. gs, gv: Render, Convert, or View PostScript and PDF Files1.11. Summary