\pcontentsline {0}{Aim}{2}{3}{} \pcontentsline {0}{Why Shell Scripting?}{3}{4}{} \pcontentsline {0}{Where to get more information}{4}{5}{} \pcontentsline {0}{The Shell is an Interpreter}{5}{6}{} \pcontentsline {0}{The Shebang}{6}{7}{} \pcontentsline {0}{Making the script executable}{7}{8}{} \pcontentsline {0}{Special Characters}{8}{9}{} \pcontentsline {0}{Special Characters---continued: 2}{9}{10}{} \pcontentsline {0}{Special Characters---continued: 3}{10}{11}{} \pcontentsline {0}{Quoting}{11}{12}{} \pcontentsline {0}{Quoting---2}{12}{13}{} \pcontentsline {0}{Quoting---When to use it?}{13}{14}{} \pcontentsline {0}{True and False}{14}{15}{} \pcontentsline {0}{Variables---1}{15}{16}{} \pcontentsline {0}{Variables---Assignments}{16}{17}{} \pcontentsline {0}{Variables---Local to Script}{17}{18}{} \pcontentsline {0}{Variables---Unsetting Them}{18}{19}{} \pcontentsline {0}{Command-line Parameters}{19}{20}{} \pcontentsline {0}{Special Built-in Variables}{20}{21}{} \pcontentsline {0}{Variables: use Braces \texttt {\$\{\dots \}}}{21}{22}{} \pcontentsline {0}{Braces and Parameters after \textbf {\$9}}{22}{23}{} \pcontentsline {0}{More about Quoting}{23}{24}{} \pcontentsline {0}{Command Substitution}{24}{25}{} \pcontentsline {0}{Command Substitution---Example}{25}{26}{} \pcontentsline {0}{Conditions---String Comparisons}{26}{27}{} \pcontentsline {0}{Conditions---Integer Comparisons}{27}{28}{} \pcontentsline {0}{Conditions---File Tests, NOT Operator}{28}{29}{} \pcontentsline {0}{Conditions---Combining Comparisons}{29}{30}{} \pcontentsline {0}{Arithmetic Assignments}{30}{31}{} \pcontentsline {0}{Arithmetic Expressions with \texttt {\$((\dots ))}}{31}{32}{} \pcontentsline {0}{Arithmetic Conditions with \texttt {((\dots ))}}{32}{33}{} \pcontentsline {0}{\texttt {if} Statement}{33}{34}{} \pcontentsline {0}{\texttt {while} Statement}{34}{35}{} \pcontentsline {0}{\texttt {for} Statement}{35}{36}{} \pcontentsline {0}{\texttt {for} Loops: Another Example}{36}{37}{} \pcontentsline {0}{\texttt {for} Loops: second, C-like syntax}{37}{38}{} \pcontentsline {0}{\texttt {break} and \texttt {continue}}{38}{39}{} \pcontentsline {0}{Blocks: \texttt {\{\dots \}}}{39}{40}{} \pcontentsline {0}{Error Handling: \texttt {\textbar \textbar }, \texttt {\&\&} and \texttt {exit}}{40}{41}{} \pcontentsline {0}{Output: \texttt {echo} and \texttt {printf}}{41}{42}{} \pcontentsline {0}{Input: the \texttt {read} Command}{42}{43}{} \pcontentsline {0}{\texttt {set}: Splitting a Multi-Word Variable}{43}{44}{} \pcontentsline {0}{More about \texttt {set}, and \texttt {IFS}}{44}{45}{} \pcontentsline {0}{Example: Changing \texttt {IFS}}{45}{46}{} \pcontentsline {0}{\texttt {case} Statement}{46}{47}{} \pcontentsline {0}{\texttt {case} Statement: Example}{47}{48}{} \pcontentsline {0}{\texttt {shift}: Move all Parameters Up}{48}{49}{} \pcontentsline {0}{\texttt {shift}: Many Places}{49}{50}{} \pcontentsline {0}{Command-Line Options---1}{50}{51}{} \pcontentsline {0}{Command-Line Options---2}{51}{52}{} \pcontentsline {0}{Command-Line Options---3}{52}{53}{} \pcontentsline {0}{\texttt {getopts}: Command-Line Options---4}{53}{54}{} \pcontentsline {0}{\texttt {getopts}: Command-Line Options---5}{54}{55}{} \pcontentsline {0}{Temporary Files: \texttt {mktemp}}{55}{56}{} \pcontentsline {0}{Signals that may Terminate your Script}{56}{57}{} \pcontentsline {0}{Signals: \texttt {trap}}{57}{58}{} \pcontentsline {0}{Signals: \texttt {trap} Example}{58}{59}{} \pcontentsline {0}{Functions}{59}{60}{} \pcontentsline {0}{Parameters in Functions}{60}{61}{} \pcontentsline {0}{Example, Calling a Function}{61}{62}{} \pcontentsline {0}{Debugging Shell Scripts---1}{62}{63}{} \pcontentsline {0}{Debugging Shell Scripts---2}{63}{64}{} \pcontentsline {0}{Writing Shell Scripts}{64}{65}{} \pcontentsline {0}{Useful External Programs---1}{65}{66}{} \pcontentsline {0}{Useful External Programs---2}{66}{67}{} \pcontentsline {0}{Regular Expressions}{67}{68}{} \pcontentsline {0}{What is in a Regular Expression?}{68}{69}{} \pcontentsline {0}{Literal characters}{69}{70}{} \pcontentsline {0}{Character Classes: \texttt {[\dots ]}}{70}{71}{} \pcontentsline {0}{Negated Character Classes: \texttt {[\textasciicircum \dots ]}}{71}{72}{} \pcontentsline {0}{Match Any Character}{72}{73}{} \pcontentsline {0}{Matching the Beginning or End of Line}{73}{74}{} \pcontentsline {0}{Match Repetitions: \texttt {*}, \texttt {?}, \texttt {+}, \texttt {\{n\}}, \texttt {\{n,m\}}}{74}{75}{} \pcontentsline {0}{Matching Alternatives: ``\texttt {\textbar }''}{75}{76}{} \pcontentsline {0}{Putting it All Together: Examples}{76}{77}{} \pcontentsline {0}{Basic \texttt {awk}}{77}{78}{} \pcontentsline {0}{What Does \texttt {awk} Do?}{78}{79}{} \pcontentsline {0}{\texttt {awk} Examples}{79}{80}{} \pcontentsline {0}{\texttt {sed}---the Stream Editor}{80}{81}{} \pcontentsline {0}{\texttt {sed}---Backreferencees}{81}{82}{} \pcontentsline {0}{\texttt {sed}---Backreferencees: Example}{82}{83}{} \pcontentsline {0}{\texttt {find} Examples}{83}{84}{} \pcontentsline {0}{Finding SUID Programs}{84}{85}{} \pcontentsline {0}{A \texttt {find} Example with Many Options}{85}{86}{} \pcontentsline {0}{\texttt {rpm} Database Query Commands}{86}{87}{}