Shell Scripting#
Series of slides covering *NIX shell environment and POSIX shell language.
Shell Interpreter(s) (TODO)#
- Bourne Shell, BSD shells
- BASH (Bourne Again Shell)
- Bashisms vs POSIX
checkbashisms
scriptbusybox
- Configuration files
- Shell history
- Command aliases
Environment (TODO)#
- Variables and values
env
/printenv
export
,unset
- Variable expansion
- Whitespace related issues
- Evil
eval
- Sourcing
- Subshells
Flow Control (TODO)#
if
/elif
/else
/fi
case
/esac
for
loopwhile
loopreturn
,break
,continue
,exit
- Standard input and output
- Heredoc and redirections
Functions and Scope (TODO)#
- Defining functions
- Global vs local scope
- Returning values
- Simulating argument list
- Importing foreign functions
- Signals and
trap
command
Regular Expressions (TODO)#
- Pattern vs match
hello
vsh...o
hel*o
,hel\+o
,hel\{1,1\}o
^$
[0-9]
,[^0-9]
,[[:alnum:]]
[abc]\|[ABC]
sed 's/\(Oh, Hi\) Mark\(.*\)/\1 Bob\2/'