Create and Use Bash Scripts: A complete guide

Make the most of this powerful tool

Photo by Obi Onyeador on Unsplash

Prerequisites:

Terminology

A little help…

Creating your bash script

Creating the bash script

Add the shebang line

#!/usr/bin/env bash

Add the echo line

echo "Hello,World!"

Save the script

Make the script executable

Running the script

The video so you can see what to do? That’s right here:

Make the script Globally available

:wq

The basics

Strings

echo hello big scary world
echo [option(s)] [string(s)]

Shell execution

Arrays

Variables

User input

Comparison and if statements

Loops

Functions

Debugging

#!/usr/bin/env bash
#!/usr/bin/env bash -x

Conclusion:

The Twitter contact:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store