Shell CommandsechoprintfsetshifttypegetoptscaseevallocalParameters and VariablesPositional ParametersSpecial Parametersstandard-vars—A Collection of Useful VariablesPatternsPathname ExpansionRegular ExpressionsParameter ExpansionThe Bourne Shell ExpansionsPOSIX Parameter ExpansionsShell-Specific Expansions, bash2, and ksh93Shell ArithmeticAliasesSourcing a FileFunctionsFunctions Are FastCommand Substitution Is SlowUsing the Functions in This Bookstandard-funcs: A Collection of Useful Commands1.1 get_key—Get a Single Keystroke from the User1.2 getline—Prompt User to Enter a Line1.3 press_any_key—Prompt for a Single Keypress1.4 menu1—Print a Menu and Execute a Selected Command1.5 arg—Prompt for Required Argument If None Supplied1.6 die—Print Error Message and Exit with Error Status1.7 show_date—Display Date in D[D] MMM YYYY Format1.8 date_vars—Set Date and Time Variables1.9 is_num—Is This a Positive Integer?1.10 abbrev_num—Abbreviate Large Numbers1.11 commas—Add Thousands Separators to a Number1.12 pr1—Print Arguments, One to a Line1.13 checkdirs—Check for Directories; Create If Necessary1.14 checkfiles—Check That a Directory Contains Certain Files1.15 zpad—Pad a Number with Leading Zeroes1.16 cleanup—Remove Temporary Files and Reset Terminal on ExitThe Unix Utilitiescat: Concatenate Files to the Standard Outputsed: A Text Stream Editorawk: Pattern Scanning and Processing Languagegrep: Print Lines Matching a Regular Expressiondate: Show or Set the System Datetr: A Character Translation Utilitywc: Count Characters,Words, and Lines in a Filefile: Determine the File Typels: Sort and Provide Details About Filesuniq: Remove Consecutive Duplicate Linessudo: Execute Commands as the Superusersplit: Divide a File into Equal-Sized Pieceswhich: Show the Full Path to a Commandgs, gv: Render, Convert, or View PostScript and PDF FilesSummary