[indiana-discuss] Change default prompt in OpenSolaris?

Marcelo Leal opensolaris at posix.brte.com.br
Thu Feb 14 05:42:23 PST 2008


I agree, the redbull (red/blue) gentoo prompt, is "one" example of
"mark" and information that identifies that GNU/Linux distribution.
 That is a really simple point that makes greater diff in IMHO.

 Leal.

2008/2/13, John Tracy <john.tracy at covenant.edu>:
> Hello All-
>  I recently installed Developer Preview 2, and was pleasantly surprised when a bash shell greeted me by default. I was wondering, however, if we may change the default prompt to be something a bit more useful than just "bash3.2$". One of the first things I do when deploying a copy of Solaris is to hack the /etc/profile file to make my prompt a bit more useful, containing my present working directory and the hostname. This is the default in a lot of Linux distributions, and if the point is to bridge the gap, I think this would be a good starting point. I'm including my settings i use in /etc/profile as a starting point, if anybody is interested.
>
>  The settings below would make a prompt look like this:
>     root at mx1:/var/tmp#
>
>  My apologies if this has already been hashed out before in this group. I don't recall having seen any discussions on this topic previously.
>
>  And, I hope I'm not stepping on anybody's toes or starting a religious flamewar. I know different folks like different prompts. I couldn't care less if you don't like mine--however I do think we should make an effort to make the prompt at least a little more informative than what is currently is.
>
>  Cheers-
>  John Tracy
>
>  #ident  "@(#)profile    1.19    01/03/13 SMI"   /* SVr4.0 1.3   */
>
>  # The profile that all logins get before using their own .profile.
>
>  trap ""  2 3
>  export LOGNAME PATH
>
>  if [ "$TERM" = "" ]
>  then
>         if /bin/i386
>         then
>                 TERM=sun-color
>         else
>                 TERM=sun
>         fi
>         export TERM
>  fi
>
>  #       Login and -su shells get /etc/profile services.
>  #       -rsh is given its environment in its .profile.
>
>  case "$0" in
>  -sh | -ksh | -jsh | -bash)
>
>         if [ ! -f .hushlogin ]
>         then
>                 /usr/sbin/quota
>                 #       Allow the user to break the Message-Of-The-Day only.
>                 trap "trap '' 2"  2
>                 /bin/cat -s /etc/motd
>                 trap "" 2
>
>                 /bin/mail -E
>                 case $? in
>                 0)
>                         echo "You have new mail."
>                         ;;
>                 2)
>                         echo "You have mail."
>                         ;;
>                 esac
>         fi
>  esac
>
>  # Let's set our default paths so things actually run
>
>         #First set path to files which should only be run by root
>         if [ "`/usr/xpg4/bin/id -u`" -eq 0 ]; then
>                 PATH=${PATH}:/sbin:/usr/sbin
>         fi
>
>         # Now let's set paths that everybody should have
>         PATH=/bin:/usr/ccs/bin:/opt/SUNWspro/bin:/usr/local/bin:${PATH}:/usr/sfw/bin:/usr/dt/bin:/usr/openwin/bin
>         export PATH
>
>  # Make our prompt pretty
>  PS1='\u@\h:\w\$ '
>  export PS1
>
>  # Set some options to keep us from making mistakes
>  set -o noclobber
>  alias cp='cp -i'
>  alias mv='mv -i'
>
>  # Let's change to VIM for our default editor
>  alias vi=vim
>  EDITOR=vim
>  export EDITOR
>
>  # Let's have pretty directory listings
>  #alias ls='/usr/local/bin/ls'
>  umask 022
>  trap  2 3
>
>  cc=/opt/SUNWspro/bin/cc
>  CC=/opt/SUNWspro/bin/cc
>  export CC
>  export cc
>
> --
>
>  This message posted from opensolaris.org
>
>  _______________________________________________
>  indiana-discuss mailing list
>  indiana-discuss at opensolaris.org
>  http://mail.opensolaris.org/mailman/listinfo/indiana-discuss
>
>


-- 
pOSix rules



More information about the indiana-discuss mailing list