The Eleventh Annual Southern California Linux Expo
February 22-24, 2013
Hilton Los Angeles International Airport

Introduction to Advanced Bash Usage


This is a broad introduction to some of the advanced features in Bash.  The intended audience ranges from marginally to incredibly experienced Bash users.


We'll cover the distinction between various command types (file, builtin, function, keyword), as well as how to find appropriate system and command documentation (type, help, apropos, man, info).  You should be able to effectively identify the type of a command and find the available system documentation on that command after this presentation.  Additionally, you will be reminded of the importance of commands like 'man man' and 'man -a intro'.


We will demonstrate effictive use of compound commands like loops (for, while, until, select), conditionals (if, case), and command groups (current shell and subshell), showing how they can be used to build functions.  String and arithmetic tests and return values will be discussed.  A special emphasis will be given to the use of for and while loops for iterating over lists to automate common or complex tasks; this part is very useful, especially when the lists are dynamically generated as the output of other commands in a pipeline or from a subshell.


We'll also explore the use of parameter expansion (variable substitution and indirection), string manipulation (subsetting, matching, replacing), and brace expansion (this one is fun).  These constructs will allow you to use Bash itself for many operations that you may currently be invoking subshells and pipelines for.  There will be a brief review of pipelines and subshells.


This talk should be accessible, but will move at a swift pace and cover lots of ground; regardless of your level of expertise, you should come out learning something, with good code examples to review after the talk.

La Jolla
Saturday, February 23, 2013 - 16:30 to 17:30