I Wrote a Script!

Celebrating small victories…

Daniel Rothamel
4 min readJun 10, 2021
“The Retired Brush” by Sweet Tea on Flickr (CC BY-SA 2.0)

I love painting.

Not creating artwork, mind you, but house painting.

Most people that I know loathe house painting. This is one reason that I know my wife, Kari, and I are perfectly matched for each other — we both like to paint together. We’ve got a history of house painting projects to prove it.

I like that painting requires patience, attention to detail, and a bit of skill to really do well. It’s not just slapping paint on a roller or brush and putting it on a wall. Done well, it takes more than that.

I also like that, when I’m painting, my progress and it’s results are immediate and tangible. I can see just how far I’ve come, and how well I’m doing, right away.

Learning Linux and scripting is a lot like painting

Just over a week into my cloud journey, what I’ve done so far shares a lot in common with painting, and I really like that.

Specifically, I’ve been spending the last 9 days learning all about Linux and how to operate within a Linux environment. All of this in preparation to become certified certified in Linux Essentials through the Linux Professionals Institute. This is a foundational aspect to a career in cloud computing.

Using Linux is a lot like painting — the results are immediate and tangible. If I do something wrong, like using an incorrect command, the system tells me right away. When I use a correct command, I get the desired output in microseconds. I like that.

Scripting might be the cut-in work of painting in Linux

Whenever you’re painting a house, you have to do what is called “cut-in” work. Basically, that means you have to first paint the small area against adjoining walls, trim, windows, around outlets, etc. This is done because the rollers can’t get those areas without making a huge mess, so you cut-in so that you can paint walls more easily.

Writing and using scripts in Linux is a lot like cutting-in. If you want to effectively operate in a Linux environment, you need to know how to write and operate scripts. Otherwise, you’ll be a lot less efficient and probably end up making a huge mess.

My first script

My mentor at Level Up in Tech shared with us a tool that we could install into our Linux environment that would help us learn, reference, and understand common Linux commands. It’s a cheat sheet for learning. Fittingly, it’s called “cheat.” But to use it, it has to be installed.

That means that we have to use a series of commands to locate, download, unzip, and install “cheat.” One way to do this is to create a script that automates this process. Once the script is written, all I have to do is execute the script, and it would run all of the commands.

I thought that this would be a good way to test myself on what I’ve learned so far, so I decided to open my vim editor and create a script to install “cheat.”

Here’s what my script looks like…

#! /bin/bash

# this is my first attempt at a script

sudo yum install git -y
cd /usr/local/bin
sudo wget https://github.com/cheat/cheat/releases/download/4.2.1/cheat-linux-386.gz
sudo gunzip cheat-linux-386.gz
sudo mv cheat-linux-386 cheat
sudo chmod 755 cheat
cheat

I saved my script. Then I ran my script, and guess what?

IT WORKED!

Small victories matter

So here’s the thing — any of you who might be reading this who are experience developers will know that this script is super simple, and frankly, unnecessary. I could have typed these commands directly into command line, instead of into a script, and achieved the same result.

Sure, that’s true.

But nine days ago, I knew literally nothing about how to operate Linux. The only two things I knew about Linux nine days ago were that it is an open source operating system, and that it has a cute penguin logo.

So, while this is a super small victory in real terms, it is also a major achievement for me, personally. It shows me that I’m truly learning the material that I’ve been studying, and that I can use it to do the things that I’m going to need to do.

This simple script is my first one, ever; and as simple as it is, it has major implications for me going forward.

Immediate, tangible results. That feels pretty damn good.

--

--

Cloud Data Delivery Engineer | Cloud career coach | I care for my Dad, who has Early-Onset Alzheimer’s disease. This is where I write about it all…