How do i set environment variable

Hi,

I am quite new to Linux. And I have doubt how to set new environment variable with value to a C executable.

Let say I have a environment variable $Hack ;
I would like to load a value for this variable; so that when the C executable is executed, the $Hack would set the variable value.

Please advise. THanks.

hack=varaible
export hack

set them in you .profile file (or the the acording config file for your shell)

Hi,

If I am using Fedora8, i only can see .bashrc file. I try to find .login or .cshrc but its not there. Must I define in .profile?

if you use bash, read the manpage for bash.

so, if not in your home, just touch the file and edit it to your needs.

hth,
DN2

Hi,

Actually, I am trying to set environment variables as in

export $HACK=/home/Desktop/test.txt

I tried in both .login and .bashrc but it didnt work. Can someone please advise. Thanks.