OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: QuantumII on January 14, 2008, 05:15:44 am

Title: Change Default "root :-)" Prompt In Pdaxii13
Post by: QuantumII on January 14, 2008, 05:15:44 am
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
Title: Change Default "root :-)" Prompt In Pdaxii13
Post by: Capn_Fish on January 14, 2008, 07:32:45 am
It's in /etc/profile, IIRC. Threre should be a line like

Code: [Select]
export PS1="root:-)"
that you would change to

Code: [Select]
export PS1= "'$(whoami)'@'$(pwd)'"
That may have a bug or two in it, but the basic format is the same.
Title: Change Default "root :-)" Prompt In Pdaxii13
Post by: QuantumII on January 14, 2008, 08:03:29 am
Thank you  How can I change the #: to become $: when I'm a normal user ?
Title: Change Default "root :-)" Prompt In Pdaxii13
Post by: Capn_Fish on January 14, 2008, 02:28:55 pm
Probably add something like this:


Code: [Select]
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.
Title: Change Default "root :-)" Prompt In Pdaxii13
Post by: QuantumII on January 14, 2008, 03:28:27 pm
Thanks again  I was thinking about using IF , but I was unsure on the correct way to do it.
Title: Change Default "root :-)" Prompt In Pdaxii13
Post by: Capn_Fish on January 14, 2008, 03:41:13 pm
No problem.
I wasn't sure how to do it either, so I looked it up. Shell scripting isn't my strong suit.