home::blog::wump

Things that go Wump in the Night..

there are only 10 kinds of people in this world..

How to add functions to your Ubuntu or other Bash Terminal Shell

Posted by Keith Wed, 12 Nov 2008 18:25:00 GMT

This is very useful.. just realized that I do so many repetitive things, eg:

cd config
ls -ltra

I thought, well I can just create a script like /usr/bin/cdl to do that, but that’s not going to work. Scripts are created in their OWN shell so you can’t use the “cd” command. It has no knowledge of the parent shell location.

So, the step is to create a function within the shell, and the easiest way to do that is create it in $HOME/.bashrc

Here’s the example above. The syntax is pretty standard and like shell scripting.

cdl()
{
cd ${1}
ls -ltra
}

Note you you have to open a new shell to see changes to bashrc


Videos that make me HAPPY!

Posted by Keith Fri, 07 Nov 2008 17:30:00 GMT

Those who know me, are well aware that I am typically a cynical bastard but behind this sarcastic persona I project is a man who cries at disney movies! Well here are some clips that really make me h-a-p-p-y.

Enjoy.

Where the Hell is Matt?

I just love the fact that he looks dumb, but is a rockstar because he doesn’t care how he looks.

Paul Potts

This is an underdog movien in 4 minutes. This guy is now a world celebrity, but best known in the UK. When this show was on TV, he hit it big via digg.com and other sites the day after this performance. I remember the day of the final sitting impatiently trying to get a feed or info about who won!

Ron Paul!

Remember this guy? Some crazy man who talked about the economy about a year ago and how things were out of control and we were heading into recession? Yeah - insane, huh!

Saving the best for last.. An astounding production.