|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
changing custom prompt ksh for root.
How to edit custom ksh prompt for root? I have already done for normal user but cann't figure out for root..
i added the following line to .profile export PS1='$PWD>' |
|
|||
I'm not finding where it was stated, but I recall that it was Nick Holland (who maintains a large portion of the official FAQ...) who said that needing to customize the root prompt shows an unnecessary dependence upon the root account. This can potentially lead to catastrophic mistakes (Everyone makes mistakes; just don't do them while logged in as root...) which would be circumvented by using sudo(8). sudo(8) can be your friend. Begin by studying its manpage. Last edited by ocicat; 30th March 2009 at 05:24 AM. |
|
|||
And I change ALL prompts
I use the following:
export PS1='\e[0;31m[\h:\w]\n\$ \e[m' in root's .profile and export PS1='\e[0;36m[\h:\w]\n\$ \e[m' for everybody else. Then if I really need to do lots of rootly stuff I do: sudo su - and end up with a red warning that I have not left root (yeah, I know the prompt is # but a red prompt sticks out like dogs balls. Whatever floats your boat, I guess. |
|
||||
terminal and shell supporting, good idea Loki.
(I usually use user@host-$ and #, where $ is colour coded to the shell; so I know just a simple '#' means the big charlie)
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
How do i enable this line for user? i added this line to .profile but it only works for root why not normal users? In normal user prompts it shows \e[0;36m[\h:\w]\n\$ \e[m instead of the colour one.
export PS1='\e[0;36m[\h:\w]\n\$ \e[m' |
|
|||
Quote:
echo $TERM give you as a non-root user? If it isn't VT220 or similar it cannot interpret the DEC colour commands. |
|
|||
echo $TERM give me xterm
the code actually works for root account but not normal user.. |
|
|||
Quote:
What I gave you works here even with xterm. Easy mistakes we all have made sometime: ' at one end " at other (I forget if that growls at you in PS1 setting) leaving out a quote or having a space in there where it should not be some other tyop Otherwise you have me beat. I've been using it for years without problems. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Nicer Prompt with ksh on 5.0 | nihonto | NetBSD Installation and Upgrading | 8 | 12th October 2009 08:49 PM |
Exec command in zsh prompt? | bsddaemon | General software and network | 2 | 18th October 2008 09:37 PM |
About Custom Kernels | qmemo | NetBSD General | 2 | 28th September 2008 03:45 PM |
Utility to make FreeBSD custom ISO | mtx | FreeBSD General | 5 | 9th June 2008 11:13 PM |
what to do at mountroot prompt? | Sunsawe | FreeBSD General | 13 | 5th June 2008 08:06 AM |