delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/30/16:43:41

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Wed, 30 Apr 2003 16:43:19 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: John Morrison <john DOT r DOT morrison AT ntlworld DOT com>
cc: cygwin AT cygwin DOT com
Subject: RE: HOME
In-Reply-To: <NCEBJJFMCAOKNNABBFIMMEBFDKAA.john.r.morrison@ntlworld.com>
Message-ID: <Pine.GSO.4.44.0304301603560.25128-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

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 AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019