10. What the hell is wrong with a GUI?
#Nothing
>For once in a life-time configurations
>Living today is pretty awesome
#Everything
>When you have to configure 20 PC's the same way
>When you don't want to install a demo-version of
some proprietary tool
>When you want to do things fast_
15. Hello World!
On stdout:
#echo hello world!
On stderr:
#echo hello world! >&2
To a file:
#echo hello world! > HELLOWORLD
To the end of a file:
#echo hello world! >> HELLOWORLD
18. Expansion
#VARIABLE=value
>All-caps not needed, just recommended
#echo ${VARIABLE}
>{} not always needed, but stops problems
>$ is necessary
#declare -i VARIABLE=value
>Specifies variable is an integer
20. Expansion
#Prevention
> escapes a single special character
>“” escapes all but $, ` and
>'' escapes all special characters
21. Loops
#for VAR in items in list; do commands; done
#exit status - $?
#test - [ condition ]
#while [ test ]; do commands; done
#until [ test ]; do commands; done
29. New expansions
Substring
#${#:0:1}
Case modification
#${var^^}
#${var^}
#${var,}
#${var,,}
30. Chopping strings
Get the extension of the current script
#${0##*.}
#${0#*.} (not correct)
Get the filename without extension
#${0%.*}
#${0%%.*} (not correct)