On Thu, 2 Mar 2000 [EMAIL PROTECTED] wrote:

> hi list ! 
> 
> I installed RH Linux 6.1 last week. I tried to create a simple c program and
> run it. When I try to run the executable (or a shell script) from my
> /home/user directory I get a message bash: command: not known to bash. To make
> the executable run I have to type the whole path like /home/user/a.out, even
> though I am in the same directory as the executable. What is causing this
> problem? Is there something like path where I can put the path? 

Environment variable PATH contains the search path for the command
interpreter to look for executables. Use the command

echo $PATH

to check it out.

You don't have to type the whole path to start a program in the current
directory, use ./a.out instead ("." means "the current directory"). If you
want to add the current dir to the path permanently, use these lines in
/etc/profile:

if [ ! "`id -u`" = "0" ]; then
 PATH="$PATH:."
fi

This means: if userid is not equal to 0 (i.e. user is not root), add
current dir to the path. Having . in the path when you're root is
BAD. Think about it and try to figure out why.

cheers
Alex



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to