My Bash Scripting Cheat Sheet

Software Engineer at BMW, Oracle Certified Professional Java SE 11 Developer
Shebang
Shebang is a combination of bash # and bang ! followed the the bash shell path. Shebang is simply an absolute path to the bash interpreter.
#! /bin/bash
Make a file executable
To make a .sh file executable only for your user, use:
chmod u+x your-file.sh
Use variables
#! /bin/bash
# A simple variable example
greeting=Hello
name=Dennis
echo $greeting $name



