Reply
Thread Tools
Posts: 26 | Thanked: 3 times | Joined on Jan 2009
#1
hi,the /sbin is not in PATH on N810, so I cannot use command like ifconfig, I've tried vi .bashrc in my home dir, but it doesnt work(the .bashrc is not sourced automatically when bash2 startup)
so what should I do next?

ps: I have installed bash2, and it always shows full path before the prompt, this is really annoying when the path is very long, how can I make only the last dir is shown like a normal shell always does?
THX
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
echo "PATH=/sbin:$PATH" >> ~/.profile

^ should work.

As for your second question, look at the file /etc/profile.d/prompt.sh and google bash PS1.

Corrected thanks to free here:
http://www.internettablettalk.com/fo...73&postcount=4

Last edited by qwerty12; 2009-02-07 at 16:14. Reason: PATH=
 

The Following 4 Users Say Thank You to qwerty12 For This Useful Post:
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#3
Read man bash, section INVOCATION:

* bashrc is not sourced for interactive login shells, only for non-login shells
* profile is source for interfactive login shells


As everything inherits from login shells, the place for $PATH setting is in a profile file (/etc/profile, /etc/bash_profile or ~/.profile, ~/.bash_profile)

Then some distributions do not follow this, they source .bashrc within .profile but it's not a general rule.
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#4
Originally Posted by qwerty12 View Post
echo "/sbin:$PATH" >> ~/.profile
Hi qwerty12!

I guess you meant

echo "PATH=/sbin:$PATH" >> ~/.profile
 
Posts: 26 | Thanked: 3 times | Joined on Jan 2009
#5
Originally Posted by free View Post
Read man bash, section INVOCATION:

* bashrc is not sourced for interactive login shells, only for non-login shells
* profile is source for interfactive login shells


As everything inherits from login shells, the place for $PATH setting is in a profile file (/etc/profile, /etc/bash_profile or ~/.profile, ~/.bash_profile)

Then some distributions do not follow this, they source .bashrc within .profile but it's not a general rule.
I just used to edit .bashrc under centos and it works fine ,so I dont know these stuff...
but I didnt login when I opened a xterminal, why it is a interactive login shell?
 

The Following User Says Thank You to leohart For This Useful Post:
Posts: 26 | Thanked: 3 times | Joined on Jan 2009
#6
Originally Posted by qwerty12 View Post
echo "/sbin:$PATH" >> ~/.profile

^ should work.

As for your second question, look at the file /etc/profile.d/prompt.sh and google bash PS1.
thank you so much
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#7
Originally Posted by leohart View Post
I just used to edit .bashrc under centos and it works fine ,so I dont know these stuff...
but I didnt login when I opened a xterminal, why it is a interactive login shell?
That's what I said, some distro do their internal cooking, when you change distro, it does not work anymore.
Why I use debian on all my machines..

When you open a terminal, it has inherited the variable PATH from the login shell.
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#8
Put this in bashrc and open a terminal, open another one within this one.
Look at your PATH, it contains two times /sbin
 
Posts: 26 | Thanked: 3 times | Joined on Jan 2009
#9
excuse me ,just curious,how can I open another terminal within a terminal?
tried osso-xterm but it doesnt work...
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#10
Sorry, I was talking in general on unix/linux machines.

I don't know for the device. BUt you can can open a new tab.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 00:27.