Quick post tonight to convey the awesomeness of bash functions. Once again, this isn't a tutorial, more of a reminder. Functions, much like aliases, can serve to save you time by allowing you to shortcut complex commands into a few key strokes. Or if you are like me, make it so you don't have to look up the same command over, and over. Obviously since bash functions just run bash commands, they are far more powerful than just shortcuts, but that is how I most often use them. It boils down to this: if I just need to run a command I make an alias; if that command needs an argument or many, I make a function. That simple. I have also included a couple basic functions that I seem to use often enough:
Since I talked about it last night, I might as well continue the trend. How about we start with customizing your bash shell with some handy-dandy aliases? Your list of shell aliases will be ever evolving with your continued usage. The rule of thumb for making a new alias is simple: if you hate typing it, alias it. That not only means commands you don't want to type out, but also common typos. For some examples and ideas, check out mine: Only thing I am missing there is that I have not added in the inevitable aliases for git.
I started off trying to write this post last night with a long and complicated explanation of my experience when I first got my job. I scraped all of that in favor of something much simpler: when I started out as a real world developer (see: getting paid) I was an idiot. But please don't misunderstand me here, I am still an idiot. The day I stop being an idiot is the day I die because, you know... I'll be dead. Thankfully for me, my overall financial health, and those I work for/with, I don't let that stop me from doing my job. Frankly I would say that most people, not even just those in software development, but everyone, is in the same boat as me though. The difference between an unsuccessful idiot and their successful counterpart is [Read more...]