Can't Alter My Path, Can't Find My Path

Can't Alter My Path, Can't Find My Path

Post by Ric » Wed, 13 Sep 2000 10:29:50



Here's the situation:

I'm a newbie logged in as root in KDE (I KNOW it's dangerous).  When I type
'echo $PATH' I get '/sbin:/usr/sbin:/usr/bin:/usr/X11R6/bin'.

In /etc/profile I found a path statement but it looks like it's part of a
sub-script and it doesn't match this path (it includes games).  I added a
'PATH=$PATH:/opt'  and an 'export PATH'.  I logged out and back in.  It made
no difference to my path statement.  I tried again with quote marks around
$PATH:/opt.  No difference.

I've checked the bash profile and bashrc.  I can't find where
'/sbin:/usr/sbin:/usr/bin:/usr/X11R6/bin' comes from.  I'm running Mandrake.

Where is the path hidden?  I've spent two days trying to find it on my own
following all the nice notes from LinuxNewbie.  I yield.  Help.

Thanks,
Ric

 
 
 

Can't Alter My Path, Can't Find My Path

Post by Craig Kelle » Wed, 13 Sep 2000 14:42:49



> Here's the situation:

> I'm a newbie logged in as root in KDE (I KNOW it's dangerous).  When I type
> 'echo $PATH' I get '/sbin:/usr/sbin:/usr/bin:/usr/X11R6/bin'.

> In /etc/profile I found a path statement but it looks like it's part of a
> sub-script and it doesn't match this path (it includes games).  I added a
> 'PATH=$PATH:/opt'  and an 'export PATH'.  I logged out and back in.  It made
> no difference to my path statement.  I tried again with quote marks around
> $PATH:/opt.  No difference.

In your HOME there is a file called .bash_profile.  Add this line to
it:

export PATH=$PATH/opt/bin

(or wherever your bin directory is under /opt)

man bash

--
The wheel is turning but the hamster is dead.



 
 
 

Can't Alter My Path, Can't Find My Path

Post by Davide Bianc » Wed, 13 Sep 2000 16:31:18




Quote:>Here's the situation:

>I'm a newbie logged in as root in KDE (I KNOW it's dangerous).  When I type
>'echo $PATH' I get '/sbin:/usr/sbin:/usr/bin:/usr/X11R6/bin'.

>In /etc/profile I found a path statement but it looks like it's part of a
>sub-script and it doesn't match this path (it includes games).  I added a
>'PATH=$PATH:/opt'  and an 'export PATH'.  I logged out and back in.  It made
>no difference to my path statement.  I tried again with quote marks around
>$PATH:/opt.  No difference.

>I've checked the bash profile and bashrc.  I can't find where
>'/sbin:/usr/sbin:/usr/bin:/usr/X11R6/bin' comes from.  I'm running Mandrake.

>Where is the path hidden?  I've spent two days trying to find it on my own
>following all the nice notes from LinuxNewbie.  I yield.  Help.

Well, I don't know how this is managed in mandrake. In my RedHat,
under /etc/rc.d/init.d there is a standard script called functions
that contains the standard definition of PATH.

If you add your path to the .bash_profile into your home directory
(~/.bash_profile) the path is not updated ? this sound strange to me.

Davide

 
 
 

Can't Alter My Path, Can't Find My Path

Post by Ric » Thu, 14 Sep 2000 10:21:03



Quote:

> Well, I don't know how this is managed in mandrake. In my RedHat,
> under /etc/rc.d/init.d there is a standard script called functions
> that contains the standard definition of PATH.

> If you add your path to the .bash_profile into your home directory
> (~/.bash_profile) the path is not updated ? this sound strange to me.

> Davide

OK, I'm on as root so home is 'root', right?  In root I find a hidden file,
.bash_profile.  I add:

export PATH=$PATH:/games

I save it.  I log off.  I restart KDE as root (I'm the only user so root is
my only choice).  I open console and type:

echo $PATH

I look at the path and there is no change.  I've added the same (and similar
versions as found on the Linux Newbie instructions site) statement to
.bashrc, /etc/profile, /etc/anacrontab, /etc/bashrc, and
/etc/rc.d/init.d/functions.  NONE of these files has any influence on my
path!!!  Is the problem with being on as root or is there still a file I
haven't butchered?

Aaaarg,

Ric

 
 
 

Can't Alter My Path, Can't Find My Path

Post by Eric » Thu, 14 Sep 2000 22:11:46





> > Well, I don't know how this is managed in mandrake. In my RedHat,
> > under /etc/rc.d/init.d there is a standard script called functions
> > that contains the standard definition of PATH.

> > If you add your path to the .bash_profile into your home directory
> > (~/.bash_profile) the path is not updated ? this sound strange to me.

> > Davide

> OK, I'm on as root so home is 'root', right?  In root I find a hidden file,
> .bash_profile.  I add:

> export PATH=$PATH:/games

> I save it.  I log off.  I restart KDE as root (I'm the only user so root is
> my only choice).  I open console and type:

> echo $PATH

> I look at the path and there is no change.  I've added the same (and similar
> versions as found on the Linux Newbie instructions site) statement to
> .bashrc, /etc/profile, /etc/anacrontab, /etc/bashrc, and
> /etc/rc.d/init.d/functions.  NONE of these files has any influence on my
> path!!!  Is the problem with being on as root or is there still a file I
> haven't butchered?

> Aaaarg,

> Ric

Can't be true, when you're logged in as root, just enter
bash at the prompt. The last/only script executed now is .bashrc
The path must be set correct now.
Are you sure you're using bash?
What does the $SHELL variable contain?

Eric

 
 
 

1. zsh's 'typeset -U path' wipes out path/PATH

I've found a bug (or at best a very perverse "feature") in zsh; it
can be illustrated by the following three short scripts:

# script_A
PATH=/usr/local/bin:/usr/bin:/bin
echo $#path
typeset -U path
echo $#path
# eof

# script_B
source script_A
# eof

# script_C
c_fxn () { source script_A }
c_fxn
# eof

Note that both the contents of script_B and the body of the function
c_fxn defined in script_C consist of the same one line, namely
"source script_A".  Now,

% source script_B
3
3
% source script_C
3
0

In words, when script_A is sourced within a script that is itself
being sourced, typeset -U path preserves the components of PATH
(or at least their number), but if script_A is sourced within the
body of a *function*, calling the function causes the expression
typeset -U path to *clear* the contents of PATH.

Please-please-please don't tell me this is a feature!  I'd lose
all faith in the designers of zsh if this turns out to be a feature!

More importantly, how does one get around this problem.  I've tried
saving the value of $path before calling 'typeset -U' on it, and
restoring it afterwards, but the results have been disastrous (I've
tried too many variants to describe them all).

kj

--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.

2. java compiler

3. methods to operate on instances of class ``Path'', was: path utility functions

4. NFSD-Bug on Solaris with Linux clients. (Part II)

5. It's not bad canned meat...

6. Kylix OE

7. OPEN FTP PORT

8. Path as "su" doesn't equal path as root or as login user

9. Almost working....font path is screwing up in X (path's correct)

10. sndconfig 'sndcore.o not found in module search path'

11. How do I find full path to program in 'c'

12. 'sh': Finding out whether I need to provide a complete path to a command