Juan Tapiador
Shell Programming
These materials are from a short course on shell (Bash) programming that I
teach periodically. The course is organized into a number of topics, taught
mostly sequentially. For each topic, there is a short text file providing a
brief introduction, code examples, and sometimes, exercises and references.
These files are not intended to replace a proper learning resource like a
textbook. Instead, they serve as a resource for me to discuss topics and
create scripts based on the fundamentals described within. Feel free to use
them as you deem appropriate.
Contents
Download all contents: shellp.tgz
- The shell
- Simple commands
- Compound commands: pipelines
- Compound commands: lists
- Execution environment
- Redirections
- Shell scripts
- Hello world
- echo
- printf
- Variables
- Variables: declaration
- Variables: types
- Variables: scope and environment
- Variables: builtins
- Variables: read
- Command substitution
- Quoting and expansions
- Patterns: globbing
- Patterns: brace
- String operations
- Positional parameters
- Integers and arithmetic expressions
- Conditional statements
- Conditional statements 2
- Conditional statements 3
- case
- select
- Arrays
- for loops
- while loops
- until loops
- break and continue
- Functions
- The fork bomb
- Signals and traps
- Debugging
- xargs
- getopts
- eval
- Obfuscation
- Terminals
- Shell configuration
Resources
This is an eclectic collection of shell resources, with a primary focus on
Bash. It includes official sources and design documents, programming guides and tools, information on coreutils internals, collections of shell scripts for study, and discussions on the UNIX philosophy.
- Official sources and references
- Programming guides
- Programming style and tools
- GNU coreutils
- The shell and the UNIX Philosophy
- Terminals
- Script collections
- Micellanea