Make your life easier with shell scripting and UNIX tools, by Devon Estes


A smart man named Larry Wall once said the three virtues of a programmer are laziness, impatience and hubris. Well, if you're not using shell scripts to automate your work, then you're probably not being lazy to your full potential!

In this workshop you'll need no prior knowledge of shell programming other than a basic familiarity of how to use a terminal, and you'll come away with the knowledge needed to write some simple but effective functions and scripts. We'll also go over how to use some of the helpful UNIX tools like cat, head/tail, grep, sed, awk, xargs and more!

For Review Committee


This workshop assumes that attendees have zero shell scripting experience. Basically, those who have never written an if statement in bash will find themselves at home here.

We'll start off with how to write a .bashrc file, some basic configuration, and our first command alias and custom function (which will update a couple git projects for us with one command).

Then we'll move on to learning about some UNIX tools to do some fun stuff with the Heroku toolbelt as we build up our second function.

We'll finish off with a real executable script, which is going to be a setup script for a Rails app (like the ones commonly found in thoughtbot open source projects). We'll take a really simple Rails blog app, and then write a setup script for any new contributor to the project to run so they can run a single command on their machine and be all set up to develop!

I'm also going to briefly introduce them to some alternative shells other than bash. I'll show a cool example of keeping track of your command line history and how to analyze that history to find patterns that can be abstracted into functions to save time and valuable keystrokes!

I intend to throw a lot of stuff at the attendees, and I don't expect them to come away having memorized what every flag does when passed to grep. But knowing the gist of what these tools do and where they can go to look for more information when they need them is a great first step.

I also want attendees to come away with a sense of pride in their newfound abilities. Shell scripting is frequently thought of as something only for "serious" programmers, and I really want to demystify some of this stuff. It's way easier than the gnarly syntax makes it seem!


We have a ton of new programmers in our wonderful Ruby community, and they're missing out on some of the joys of shell scripting for a bunch of reasons.

First and foremost, there aren't many good resources out there to learn the basics of shell scripting - man pages are overwhelming and very few people teach this topic in a way that's suitable for novice or junior developers. Also, there's this image of people who can write shell scripts and know serious shell-fu as really gnarly old-school neckbeards with 10+ years of C++ experience, so many think it "isn't for them".

It doesn't have to be this way! Anyone can learn to write simple shell scripts that can make their lives much better by automating boring or time consuming processes - and I mean write, not copy and paste from Stack Overflow or someone's dotfiles on GitHub.

Not only is this important because of the productivity benefits that folks can achieve, but I've seen so many new developers have a huge boost in confidence when they learn a couple command line tricks and write their first bash functions. That's when they really start to feel like they're "real" engineers, and I'd like to give more people that feeling. I've seen this in my junior colleagues that I've taught some shell scripting stuff to, and I think it was a huge turning point in their development. Plus, the basic concepts are actually quite simple, and I think we can get a lot done in 90-120 minutes and come away with some really cool stuff!

Edit proposal


RailsConf 2017 - Accepted [Edit]

Add submission