BASH Cheat Sheet With StackOverflow References

If statements

Example If Then Else Statement

if [ $BACKUP_STATUS = 1 ] ; then

wget -q "https://backup-manager.test/api/job?api_token=xyz&id=1&status=$result"

How to Output the Date

Calculate time differences

Source a file in the same directory

Truthy / falsy (boolean) values

Can you nest if statements in Bash?

4 Bash If Statement Examples ( If then fi, If then else fi, If elif else fi, Nested if )

Typical error:

line 44: [: =: unary operator expected

Bash Unary Operator Expected: What Does It Mean?

how to see in bash if a variable is set

Output hostname in Bash


Getting Hostname in Bash in Linux

How to concat variable in Bash

A Bash function with variables


greeting () {
   echo "Hello $1"

greeting "Joe"

That was fun!

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top