Scripting
From Linuxintro
Revision as of 05:12, 4 October 2010 by imported>ThorstenStaerk
foo() { }
defines a function in bash.
Usecases
Delete linebreaks
cat file | tr '\
' '; ' > newfile
TroubleShooting
Use xtrace to get every line of a script shown before the line is executed.
If you want every line to be shown with evaluated values, write the following to the beginning of the script:
set -x
or -xv for verbose