![]() ![]() |
Jan 14 2008, 02:15 AM
Post
#1
|
|
|
Group: Members Posts: 5 Joined: 27-December 07 Member No.: 21,119 |
Hi
I was just wondering how I can change the default root :-) prompt to something like root@zaurus#: ? it's just a variable somewhere,right ? Thank you in advance |
|
|
|
Jan 14 2008, 04:32 AM
Post
#2
|
|
![]() Group: Members Posts: 2,350 Joined: 30-July 06 Member No.: 10,575 |
It's in /etc/profile, IIRC. Threre should be a line like
CODE export PS1="root:-)" that you would change to CODE export PS1= "'$(whoami)'@'$(pwd)'" That may have a bug or two in it, but the basic format is the same. |
|
|
|
Jan 14 2008, 05:03 AM
Post
#3
|
|
|
Group: Members Posts: 5 Joined: 27-December 07 Member No.: 21,119 |
Thank you
|
|
|
|
Jan 14 2008, 11:28 AM
Post
#4
|
|
![]() Group: Members Posts: 2,350 Joined: 30-July 06 Member No.: 10,575 |
Probably add something like this:
CODE if [ "`id -u`" -eq 0 ]; then export PS1='\u@\h:\w\# ' else export PS1='\u@\h:\w\$ ' fi That's adapted from the /etc/profile on my Debian box, so it ought to be good. EDIT: That assumes your shell is bash. If not, it likely won't work, and you'll have to adapt the one above using this format. |
|
|
|
Jan 14 2008, 12:28 PM
Post
#5
|
|
|
Group: Members Posts: 5 Joined: 27-December 07 Member No.: 21,119 |
Thanks again
|
|
|
|
Jan 14 2008, 12:41 PM
Post
#6
|
|
![]() Group: Members Posts: 2,350 Joined: 30-July 06 Member No.: 10,575 |
No problem.
I wasn't sure how to do it either, so I looked it up. Shell scripting isn't my strong suit. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th June 2013 - 03:28 PM |