Re: "command not found"


Benjamin Karas (bjk4@po.cwru.edu)
Fri, 11 Jun 1999 00:31:43 -0400 (EDT)


On Fri, 11 Jun 1999, Evan Read wrote:

> On Thu, 10 Jun 1999, JP Rosevear wrote:
>
> > Evan wrote:
> > >
> > > not sure of exactely what you mean, but I am running it from the directory it
> > > is located in.
> > >
> > > Something else of note, when it was installed, is belonged to "USERS" group. I
> > > changed that to ROOT (and had the same problem).
> > >
> > > yes, as you can tell, I am trying to run it as root (I haven't been bothered to
> > > create enough permissions for my unroot self.
> >
> > What he means is that when you are trying to run an executable, linux
> > will look for the executable ONLY in the directories in the PATH
> > variable unless a path is explicitly entered. The '.' means the current
> > directory so './rc5des' tries to execute the rc5des program in the
> > current directory.
>
> egads!!! that explains alot! where can I add to the PATH variable?
>
> Note that I am running the program in /root (otherwise known as ~/in my
> case) so I
> think that is in the path.
>
> > If you are using the bash shell (most people do), use tab completion to
> > test the shell sees it and it is executable (the shell won't tab
> > complete the first thing on the command line unless it is exectuable).
> >
>
> I am using BASH, yes. I tried the autocomplete and it doesn't see it as
> an executable.
>
> So, what now, folks?

Well, you're doing good so far...
Bash stores a bunch of information about your computer's setup in
a number of variables. You can list all the variables by typing 'set'.
Set also allows you to change these variables using the syntax 'set
VARIABLE=VALUE'. You can also use 'export' to set a variable for the
remainder of a session.

The PATH variable is a list of directories seperated by colons.
To change the path for one session, you can type:
export PATH=$PATH:.
The '.' is the added path, with a ':' to seperate it from the old ones.
$PATH tells bash to insert the current value of PATH into the expression,
thus adding the current directory. A quick way to display the current
PATH is to type 'echo $PATH'.

To permanently add the current directory for a user, you must edit a
startup file so that the above command is executed every time that user
logs in. Typically, this file is ~/.bashrc
Add the line 'export PATH=$PATH:.' to the .bashrc file in your home
directory if you like. The global startup file is usually /etc/bashrc

The reason the current directory is not always included in a path is
because it might be possible for a cracker to trick you into running a
malicious program. If you trust the users on your machine, then you might
be safe in adding this directory. If you don't trust the users on your
machine, then you shouldn't do this.

Hope this nails the problem on the head.

-Ben Karas

BTW, my current path is long:
/opt/kde/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/home/bjk4/bin:/usr/local/bin:/usr/local/bin
This all got set automatically through a series of startup scripts.

>
> please reply to : eread@netaccess.co.nz (or reply all), I did this from
> work.
>
>
>
>



This archive was generated by hypermail 2.0b3 on Wed Jun 30 1999 - 11:30:08 MDT