Friday, November 9, 2007

Shell: CDPATH

While in a new job I finally got some time to re-read some basics, like the shell scripting and some UNIX tips and tricks. So today I re-discovered the CDPATH.

I've borrowed the following explanation from somewhere else.

The CDPATH environment variable defines additional locations to be searched when you type the cd command. When you type cd A, cd will look for A in the current directory. If you define the CDPATH environment variable which consists of a list of directories, cd will look for A in the current directory and if it is not found, the search continues in the directories defined in CDPATH, from left to right, stopping at the first place where it is found. Your working directory is then switched to A.

Example:

smol@eclipse:~$ pwd
/home/smol

smol@eclipse:~$ ls
foo bar
smol@eclipse:~$ ls /tmp
baz
smol@eclipse:~$ export CDPATH=/tmp
smol@eclipse:~$ cd baz
/tmp/baz
smol@eclipse:/tmp/baz$


Quite handy, something every UNIX admin likely knows already. Here is some further reading on Bash scripting features.

Bits and bytes of my analog life

Silly title, but what the heck, there are so many changes in my life right now.

Eva: After seven years of living together my girlfriend left me and I feel empty and miserable, I really do. Something is broken in me and I do not know how to fix that.

Work: I've quit my work at DHL. Last four years were excellent when it comes to my professional carrier and I'm really gratefull to DHL for letting me grow. Access to technology one cannot see anywhere else but what I really liked the most was the team of people and the "FUN" of a corporate life we shared. So, Lukas, Pepe, Marketko, Zdendo, Ondreji, Peetee, Honzo, Marku, Petre, Radime and all you many others I forgot to mention, thank you for being so great to me, thank you for being such a great team and friends. I hope we will stay in touch wherever we go.

Work2: And I got a new job. I should say it is a dream job. My current position is Linux Consultant for Denmark/Japanese corporation operating at monitoring field for telco companies all around the world. That means working with open-source technologies, learning more about GSM/GPRS/UMTS networks and lot of traveling and since I'm still below thirty, I'm really looking for that. Recently I had a feeling that my capability to absorb every happening in open-source movement is dropping and I should specialize on a subset of that. So lets try.