23 Aug 2015
Automation Via Aliasing and Bash
I’ve been trying to make a concerted effort recently to automate more stuff. Working on a side project or open source project you haven’t touched in a while I’ve found can be annoying to get back into - first navigate to the directory, run a few tasks to set up the DB, install dependencies, pull from master, etc.
With that in mind, I’ve taken to some aggressive aliasing on a few side projects to get to the fun stuff more quickly. I thought I’d jot down a few interesting takeways from the experience.
All of the below assume you have a
.bash_profile set up.
- On your home setup, it’s worth having aliases to navigate to a project immediately.
- For setup tasks, it’s tempting to chain together a bunch of terminal commands with
&&, but bash functions I’ve found make for easier edits in the future and are more elegant as well.
- For anything that involves sshing into another machine, it’s nice to alias:
- Finally, I like having easy access to my
.bash_profile, so it makes sense for me to alias the following:
I admit a reasonable knock against aliasing is that when you move over to another machine, you’re a fish out of water. However, I’d like to believe if I take a few minutes every month to review my
.bash_profile , I can partially mitigate this risk.