The Bash Scripting Tutorial, Part 1

Using Bash Scripts To Automate Your Workflow

Vickie Li
The Startup

--

If you work with computers, there’s probably been a time where you’ve thought: “Wow, there’s got to be a way I can automate this”.

A computer script is a list of commands designed to be executed by a program. They are used to automate tasks such as data analysis, webpage generation, and system administration. And the ability to understand and create scripts is one of the most sought after skills in the IT world.

So today, let’s talk about scripts. We will talk about bash scripts in particular, what they are, and why you should use them. Then, we will write and run a simple bash script of our own.

What Is A Bash Script?

Bash stands for “Bourne Again Shell”. It is a shell interpreter that takes in commands from the user and performs actions using operating system services.

For example, when you open up the terminal and type in the command “ls”, you will see a listing of the contents of the current directory. What you see here is the shell interpreter at work.

The bash interpreter can also read commands from a file that the user has previously written and saved. This is called a “bash script”: a file composed of a list of shell commands.

--

--

Vickie Li
The Startup

Professional investigator of nerdy stuff. Hacks and secures. Creates god awful infographics. https://twitter.com/vickieli7