Shell Script 101

Shell script is undervalued for how prevalent it is used in software development. Shell commands are everywhere. A non-exhaustive list of my day to day use of shell commands includes: bash profile, setting up a local dev environment, rotating Github ssh keys, scripting a makefile, commands run on a CICD box, docker entry commands, startup scripts, jobs running on a server, and shelling into broken things.

Understanding shell and using it proficiently requires understanding how commands are combined and chained, and how variables and environment variables are scoped. This session cover many common bash commands. I will show how to use man to understand commands, as well as examples of how to use awk, echo, grep, cat, sed, xargs, eval, read, jq, and a few others.

Demos of commands include how to create a cli weather bug based on ip address, how to make a mac book pro tell you a joke, seamlessly switch between kube clusters, set up a bash profile, change the color of parts of a string, apply a comand to every file in a directory, and wait for feedback.

There are times where teams near you will use .net, or they have a Windows dev environment. Powershell is similar to bash, but completely different. This session will include a short section on powershell commands.

The entire slide deck for this session on shell script is written in shell scripts, and it will eventually be available on Github.

Speaker

corwin-diamond

Corwin Diamond


I am currently focused on observability and deployment tooling. I have previous experience with Android development and full stack applications.