OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Change Default "root :-)" Prompt In Pdaxii13, How do I change this?
QuantumII
post 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
Go to the top of the page
 
+Quote Post
Capn_Fish
post 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.
Go to the top of the page
 
+Quote Post
QuantumII
post Jan 14 2008, 05:03 AM
Post #3





Group: Members
Posts: 5
Joined: 27-December 07
Member No.: 21,119



Thank you smile.gif How can I change the #: to become $: when I'm a normal user ?
Go to the top of the page
 
+Quote Post
Capn_Fish
post 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.
Go to the top of the page
 
+Quote Post
QuantumII
post Jan 14 2008, 12:28 PM
Post #5





Group: Members
Posts: 5
Joined: 27-December 07
Member No.: 21,119



Thanks again smile.gif I was thinking about using IF , but I was unsure on the correct way to do it.
Go to the top of the page
 
+Quote Post
Capn_Fish
post 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th June 2013 - 03:28 PM