Heal Your Church WebSite


Teaching, rebuking, correcting & training in righteous web design.

using .profile to export shortcuts

Here’s another ancient draft I dug up. I posted this one after my wife (a.k.a. all-knowing Unix Chix) reminded me how to create/export environment variables that I could use as shortcuts when navigating the command line shell.

For example, you’ll notice in my code examples, I often use the $HOME which is created for me by default, instead of typing in “/home/healyourchurchwebsite”. Similarly, I’ve created/exported some environment variables of my own merely by making the following entries in my $HOME/.profile file:

export MT=”/home/healyourchurchwebsite/public_html/cgi-bin/mt”
export PIX=”/home/healyourchurchwebsite/public_html/images”

This makes it real easy then to change directories and/or edit files in other directories without having to remember long path names. For example,

cd $HOME
pico $MT/ mt.cfg
cp $MT/foo.gif $PIX/.

Your .profile should be in your $HOME directory. To list it, try ls -la $HOME. My own system does not provide one with default, so I created one. That said, CHECK WITH YOUR WEB HOSTING COMPANY before you do this to make sure you’re not shooting yourself in the foot.

I know to some of you this doesn’t seem like much, but for me, it has been a real time saver.

Comments are closed.