Shell Scripting
Created: 02.02.2025
Updated: 12.03.2025
- use posix compliant shell (dash, yash, ksh, oksh, mksh, etc.)
- shellcheck
# Variables
- outside of functions are valid in the whole file (global)
- only valid inside the function if you write local before them
- echo, sleep
# this is a comment
what="a" # variable
$what # access variable
read input # read input from user and put it into input variable
Other things: Positional Arguments, If else, Array, For-Loop, Functions (with return), command concatenation, stdin, stdout, stderr
# Credits/See Also
- luke smith playlist
- https://man.openbsd.org/ksh
- https://steinbaugh.com/posts/posix.html
- https://cheatography.com/spartan782/cheat-sheets/posix/pdf/s
- look at my scripts