Thursday, May 30, 2013

Updating my bash

Bash is a command language interpreter (i.e. shell) that executes commands from standard input or file. It was written by Brian Fox to replace the Bourne shell. The name is an acronym for the 'Bourne-Again SHell'  a pun on Stephen Bourne, the author of the current Unix shell sh. (Bash manual)

A few days after I started at 8th Light, Eric updated my bash to make it more readable. It has colors and smilie faces to indicate whether or not the last command was successful. Eric's bash profile is on github in case you want to update yours too. Since then, Eric gave two presentations on Bash which gave me a little confidence on changing mine. Here is what mine looks like currently:


There are several things to note here: 
1. When the shell is able to execute my command successfully, it gives me a green happy face ^_^
2. When it fails, it gives me a red "D'OH" face >_<
3. When I list the directory, the files are in grayish and the directories are cyan
4. It also tells me which branch I'm on and whether or not I made updates on the branch. The "+" show I added files to the directory. 

All the files for these changes are in ~/.bash. You can open it and explore. I made the face and color changes changes in the prompt file. 

While I had some confidence left, I decided to fix the thing that was most annoying to me, the case sensitive auto complete. For example, I have the folder Ruby. If I type "ru" then hit tab, it won't do anything. If I type "Ru" then it will show "Ruby". Nick Burwell had a blog post on this that seems super easy and clean. Note that this command add to the file, so you don't have to worry about overriding the file. Awesome eh? 

echo "set completion-ignore-case On" >> ~/.inputrc

Resource:

0 comments:

Post a Comment