Skip to main content

My Bash Scripting Cheat Sheet

Published 1 min readMarkdown
My Bash Scripting Cheat Sheet

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

About the author

  • Software Engineer at BMW, Oracle Certified Professional Java SE 11 Developer

No comments yet. Be the first to comment.