chaostic
Group: Members
Posts: 328
Joined: Mar. 2005 |
|
Posted: July 22 2008,21:35 |
|
on OSx: PS1='\u@\h:\w ' chaostic@OSX:~ chaostic@OSX:~ cd Desktop/ chaostic@OSX:~/Desktop
On DSLcore, the standard prompt for now.
on DSL 3/4, I mostly use ssh, so the standard prompts for user or root are used unless I ssh'd in. Then it gets colored, and shows the hostname of the incoming ssh connection:
Code Sample | # SSHHOST shows the arp table, grepping it for the line with the ip address you are shhing from in, then cuts the hostname out [ -n "$SSH_CLIENT" ] && SSHHOST=$(arp -a | grep `echo $SSH_CLIENT|cut -f1 -d\ ` | cut -f1 -d\ )
# Creating command prompt, using SSHHOST to add dynamic host name to prompt if SSHing in # PS1 = [Cyan/Underlined](Host where you are SSHing from)[No Color][Blue](SHHing through)[Light Red/Bold](User AT host:PWD)(Space)[No Color] [ -n "$SSHHOST" ] && PS1=$'\\[\E[36;0;4m\\]$SSHHOST\\[\E[0m\\]\\[\E[36;0m\\]*\\[\E[31;1m\\]\\u@\\h:\\w \\[\E[0m\\]'
|
remotehostname*dslusername@dslhostname:path OSX*dsl@box:~ OSX*dsl@box:~ cd /var/tmp OSX*dsl@box:/var/tmp
OSx would be underlined and blue, * would be blue, and dsl@box:~ would be light red.
I didn't make one for root yet (Don't really spend much time as root, so the plain jane prompt is warning enough)
|