set path

set path

Post by Bria » Thu, 07 Sep 2000 09:16:17



I have been unable to edit my $PATH or find any info on how to do it.
One article said my path was in the '.profile' file, but neither /root or
/home/<user> directories contain this file.
I magazine article described such utilities as : addpath, delpath, edpath,
listpath, uniqpath, but none of these appear to be in the man or info pages.
Where is the path variable kept and how do I edit it?

Thanks
Brian

 
 
 

set path

Post by Arturo » Thu, 07 Sep 2000 09:34:41



>I have been unable to edit my $PATH or find any info on how to do it.
>One article said my path was in the '.profile' file, but neither /root or
>/home/<user> directories contain this file.
>I magazine article described such utilities as : addpath, delpath, edpath,
>listpath, uniqpath, but none of these appear to be in the man or info pages.
>Where is the path variable kept and how do I edit it?

global settings can go in /etc/profile  User specific ones can go in
~/.bash_profile  if using bash shell.

 
 
 

set path

Post by Eric » Thu, 07 Sep 2000 15:40:56



> I have been unable to edit my $PATH or find any info on how to do it.
> One article said my path was in the '.profile' file, but neither /root or
> /home/<user> directories contain this file.
> I magazine article described such utilities as : addpath, delpath, edpath,
> listpath, uniqpath, but none of these appear to be in the man or info pages.
> Where is the path variable kept and how do I edit it?

> Thanks
> Brian

It's kept in your shell ;-)
But that should lead you directly to where to set it:
The place where you set your shell variables.
system wide : /etc/profile
single user : ~/.profile (for ksh)
              ~/.bash_profile (for bash)
              for other shells?? I don't know, but it'll be obvious
enough.

ofcourse you can change it directly (you'll need to login again if you
need the profile changes to take effect) by export
PATH=$PATH:/your/path/goes/here

Eric

 
 
 

set path

Post by Ron Ros » Fri, 08 Sep 2000 01:23:12



> I have been unable to edit my $PATH or find any info on how to do it.
> One article said my path was in the '.profile' file, but neither /root or
> /home/<user> directories contain this file.
> I magazine article described such utilities as : addpath, delpath, edpath,
> listpath, uniqpath, but none of these appear to be in the man or info pages.
> Where is the path variable kept and how do I edit it?

On my system, Slackware 7 (Bigslack), this resides in /etc/profile, and
that's where I've successfully changed $PATH and other global variables.
It's also possible to set environment variables per user through scripts
in the home directory (like .bashrc - depends on your shell... but I'm a
newbie, so you'd best look it up).

Ron.

 
 
 

set path

Post by Harring Figueired » Fri, 08 Sep 2000 00:30:19


To edit the path for a  single shell, do
export PATH=$PATH:<your/new/path/goes/here>

Example:
  Let's try to execute the fortune program:
========== On the system shell =========
  $ fortune
  bash: fortune: command not found
  $
=========
  Now, if I do :

  $export PATH=$PATH:/usr/games/fortune
   and run the program again, I get:

  $fortune
Truth has no special time of its own.  Its hour is now -- always.
                -- Albert Schweitzer

to see the value, type
$ echo $PATH

To edit a path to have it "fixed" everytime you log in or open a shell,
insert the export statemnet  above at the end of the file  $HOME/.bashrc . if you
don't have one, try copying one from either the root account or someone else.

I am assuming that you are using LINUX and bash as a shell.

If it is another shell, let me know.

 Hope this helps.

Harring



> > I have been unable to edit my $PATH or find any info on how to do it.
> > One article said my path was in the '.profile' file, but neither /root or
> > /home/<user> directories contain this file.
> > I magazine article described such utilities as : addpath, delpath, edpath,
> > listpath, uniqpath, but none of these appear to be in the man or info pages.
> > Where is the path variable kept and how do I edit it?

> On my system, Slackware 7 (Bigslack), this resides in /etc/profile, and
> that's where I've successfully changed $PATH and other global variables.
> It's also possible to set environment variables per user through scripts
> in the home directory (like .bashrc - depends on your shell... but I'm a
> newbie, so you'd best look it up).

> Ron.

 
 
 

set path

Post by Harring Figueired » Fri, 08 Sep 2000 00:32:02



> To edit the path for a  single shell, do
> export PATH=$PATH:<your/new/path/goes/here>

> Example:
>   Let's try to execute the fortune program:
> ========== On the system shell =========
>   $ fortune
>   bash: fortune: command not found
>   $
> =========
>   Now, if I do :

>   $export PATH=$PATH:/usr/games/fortune   ***** SORRY , this is wrong, should have
> been only

    export PATH=$PATH:/usr/games

>    and run the program again, I get:

>   $fortune
> Truth has no special time of its own.  Its hour is now -- always.
>                 -- Albert Schweitzer

> to see the value, type
> $ echo $PATH

> To edit a path to have it "fixed" everytime you log in or open a shell,
> insert the export statemnet  above at the end of the file  $HOME/.bashrc . if you
> don't have one, try copying one from either the root account or someone else.

> I am assuming that you are using LINUX and bash as a shell.

> If it is another shell, let me know.

>  Hope this helps.

> Harring


> > > I have been unable to edit my $PATH or find any info on how to do it.
> > > One article said my path was in the '.profile' file, but neither /root or
> > > /home/<user> directories contain this file.
> > > I magazine article described such utilities as : addpath, delpath, edpath,
> > > listpath, uniqpath, but none of these appear to be in the man or info pages.
> > > Where is the path variable kept and how do I edit it?

> > On my system, Slackware 7 (Bigslack), this resides in /etc/profile, and
> > that's where I've successfully changed $PATH and other global variables.
> > It's also possible to set environment variables per user through scripts
> > in the home directory (like .bashrc - depends on your shell... but I'm a
> > newbie, so you'd best look it up).

> > Ron.

 
 
 

1. set path = "$path" hoses path in tcsh -- why???

All:

  % echo $path
  /usr/local/bin /usr/pubsw/bin /usr/bin ...
  % ls
  [... etc ... it works]
  % set path = "$path"   *** What the hell happens here??? ***
  % echo $path
  /usr/local/bin /usr/pubsw/bin /usr/bin ... looks the same
  % ls
  ls: Command not found.

This is just a particularly egregious illustration of the problem. In
general, if I try to do something like this:

  % set savedPath = "$path"  # Save current path
  % set path = "$savedPath"  # Restore saved path

it doesn't work. The path *looks* the same, but the shell can't find
anything. Recall that the shell variable path and the environment
variable PATH are linked, so setting one automatically sets the other
also. Some unexpected feature of list interpolation perhaps? Bug or
feature, I call it a pain...

Andrew Duncan

2. smit update_all failed for y2k patch filesets

3. need general help with setting paths & man paths for apps

4. Welcome to comp.unix.questions [Frequent posting]

5. setting path

6. Email filtering

7. set path does not work for root

8. APC BackUPS Pro 420 Problems

9. Setting $path for root rsh commands in Solaris 2.3

10. Setting path for x-server

11. setting PATH?

12. setting path for superuser

13. help! XDM : where to set PATH ?