Useful tips to make your bash scripts look professionally

To make your bash scripts look professionally, consider to add the following entries to the header section of your script.

1. Add author section:

#!/bin/bash

# Author: John Doe

2. Add creation date:

#!/bin/bash

# Author: John Doe
# Date created: 11/06/2021

3. Add modification date:

#!/bin/bash

# Author: John Doe
# Date created: 11/06/2021
# Date modified: 15/12/2021

4. Add description section explaining what your script does:

#!/bin/bash

# Author: John Doe
# Date created: 11/06/2021
# Date modified: 15/12/2021

# Description: 
# Script calculates the sum of two input numbers and prints the output to the screen

5. Add usage section explaining how to use your script:

#!/bin/bash

# Author: John Doe
# Date created: 11/06/2021
# Date modified: 15/12/2021

# Description: 
# Script calculates the sum of two input numbers and prints the output to the screen

# Usage:
# $ ./my-script arg1 [arg2]
# * arg1: <description>
# * arg2: <description>

Example script

#!/bin/bash

# Author: John Doe
# Date created: 11/06/2021
# Date modified: 15/12/2021

# Description: 
# Script calculates the sum of two input numbers and prints the output to the screen

# Usage:
# $ ./my-script arg1 [arg2]
# * arg1: <description>
# * arg2: <description>

sum=$(( $1 + $2 ))

echo "Sum is: $sum"

exit 0