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.
If bash is invoked with the name sh, it tries to mimic the startup
behavior of historical versions of sh as closely as possible, while
conforming to the POSIX standard as well. When invoked as an interac
tive login shell, or a non-interactive shell with the --login option,
it first attempts to read and execute commands from /etc/profile and
~/.profile, in that order.
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.