I'm disturbed by the fact that you mention a PATH 'statement'.  I'm not
trying to be picky about nomenclature, but it indicates that perhaps you
are not using the correct syntax.

What you need is a PATH 'assignment'.

What do you get when you type "echo $PATH"?  You should get a
colon-separated list of directories.  For instance:
----------
[petep@petep petep]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/bin/mh:/usr/homes/petep/bin
----------
If the directory containing your command is not in this list, your command
won't be found.  Unlike the case of Micro$oft shells, ".", the current
working directory, is *NOT IMPLICITYLY IN YOUR PATH*.  If you want always
to look for commands in the current directory, you need to include "." as
part of your path.  This is not recommended for root and it's probably a
good idea to put it at the *END* of your path if you put it in at all.

How you set or modify your path depends on what shell you're using.

In bash, you can say:
    export PATH=$PATH:your_addition
where 'your_addition' indicates the directory you wish to add.  If you want
your addition to come *BEFORE* the original path elements, you would do:
    export PATH=your_addition:$path


In zsh, you can do the same thing, but the first case needs curly brackets
around PATH as in the csh/tcsh example below, to keep the colon from being
interpreted as a symbol-modifier:
    export PATH=${PATH}:your_addition


In standard 'sh', you have to do it in two steps, e.g.:
    PATH=$PATH:your_addition; export PATH
    

In csh or tcsh, you can do:
    set path=($path your_addition)
      The shell will set the environment variable 'PATH' from the shell
      variable 'path'.  Note the parentheses and the space instead of colon.
or
    setenv PATH ${PATH}:your_addtion
If you added the command *AFTER* the shell you're using was started, you
need to do a "rehash" in csh or tcsh.  These shells make a lookup table of
all the executables in $PATH when the shell is started.  'rehash' forces it
to regenerate the list.


        pete peterson
        GenRad, Inc.
        7 Technology Park Drive
        Westford, MA 01886-0033

        [EMAIL PROTECTED] or [EMAIL PROTECTED]
        +1-978-589-7478 (GenRad);  +1-978-256-5829 (Home: Chelmsford, MA)
        +1-978-589-2088 (Closest FAX); +1-978-589-7007 (Main GenRad FAX)
 


> Date: Fri, 29 May 1998 07:20:49 +0200 (CEST)
> From: Zoki <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: RE: Scripts...
> Message-ID: <Pine.LNX.3.96.980529071916.691C-100000@localhost>
> Content-Type: TEXT/PLAIN; charset=US-ASCII
> 
> On Thu, 28 May 1998 [EMAIL PROTECTED] wrote:
> ->On Thu, 28 May 1998, Zoki wrote:
> ->
> ->> First mistake was because of a wrong statement in the script. Next problem
> ->> is that it still doesn't work - even with chmod 755 and the dir in the
> ->> path - I still have to type ./myscript. Then it works okay. What's the
> ->> deal on this? Why doesn't it accept the PATH statement?
> ->
> ->what dir are you in when you do ./myscript?  and try $PATH at the prompt
> ->to make sure that /usr/local/bin is in it and then double check to see if
> ->myscript is in /usr/local/bin.  I've had probs before where dirs just
> ->disappear from my path, but thats prolly cuz i don't know what i'm doing
> 
> Everything seems okay, and it still doesn't work. I am in any dir when
> trying to use the command.


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to