Bash Programming
- We need to spend some time writing programs in a few scripting languages.
- I will start with bash. (UG)
- I can write bash scripts with a manual
- But I would much rather go to python for most tasks.
- I am using Bash Shell Scripting
- Variables
- Everything is a string unless otherwise noted.
- And the shell will perform variable expansion all over the place.
- ${varname} is safest, but often skipped.
- $varname is probably ok, but sometimes a problem
- "$varname" is good too
- but ' suppresses the interpretation
- '$varname' is the litteral string
- There are some special variables.
- $? - the exit status of the most recently executed command
- $$ the process id.
- $0, $#, $@ and $* as we have seen.
- And an entire list of others