This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: HOME


On Wed, 30 Apr 2003, John Morrison wrote:

> > From: Igor Pechtchanski
> >
> > Yep, you're quite right.  I was looking at my own (heavily edited)
> > /etc/profile, forgetting that it wouldn't have been overwritten by newer
> > versions on upgrade.
>
> Is there anything in your version you think would be good in
> the 'default' version?  Even commented out?
>
> J.
> "/etc/profile maintainer" ;)

Good point...  Let's see:

MANPATH="/usr/man:/usr/local/man:/usr/autotool/devel/man:$MANPATH"
export MANPATH

case "$0" in
bash | -bash | */bash)
export HOSTNAME=`echo "$HOSTNAME" | /bin/tr 'A-Z' 'a-z'`
export PS1='\[\033]0;\w\007
\033[32m\]\u@${HOSTNAME} \[\033[33m\]\w\[\033[0m\]
$ '
;;
ksh | -ksh | */ksh)
typeset -l HOSTNAME
export PS1='^[]0;${PWD}^G
^[[32m${USER}@${HOSTNAME} ^[[33m${PWD}^[[0m
$ '
;;
sh | -sh | */sh)
export PS1='$ '
;;
esac

In the ksh section, the ^[ is the actual ESC character (Ctrl-V ESC in vi),
and, likewise, ^G is the actual BEL.  I've also made it ash-friendly (no
"export VAR=VAL", no alias commands)...  Looks like some files in
/etc/profile.d aren't as sh-friendly (try "exec -l /bin/sh -x" sometime).

Oh, and in my .bashrc:

# Don't wait for job termination notification
set -o notify
# Don't use ^D to exit
set -o ignoreeof

alias -- less='/bin/less -r'
alias -- ls='/bin/ls -F --color=tty'
alias -- rm='/bin/rm -i'
function settitle() { echo -n "^[]2;$@^G^[]1;$@^G"; }
alias -- whence='type -a'

Again, the ^[ and ^G in settitle() are the actual ESC and BEL characters.

That looks like it.  "The rest is personal, private, of no possible
int'rest" (Dr. "Stinky" Mahmoud).
Hope this helps,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]