OESF Portables Forum
Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started 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
-
It's in /etc/profile, IIRC. Threre should be a line like
export PS1="root:-)"
that you would change to
export PS1= "'$(whoami)'@'$(pwd)'"
That may have a bug or two in it, but the basic format is the same.
-
Thank you How can I change the #: to become $: when I'm a normal user ?
-
Probably add something like this:
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.
-
Thanks again I was thinking about using IF , but I was unsure on the correct way to do it.
-
No problem.
I wasn't sure how to do it either, so I looked it up. Shell scripting isn't my strong suit.