This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
RE: HOME
- From: "John Morrison" <john dot r dot morrison at ntlworld dot com>
- To: "cygwin" <cygwin at cygwin dot com>
- Date: Mon, 5 May 2003 16:43:39 +0100
- Subject: RE: HOME
OK, proposed /etc/profile (.bashrc to follow later)
J.
# Some resources...
# Customizing Your Shell: http://www.dsl.org/cookbook/cookbook_5.html#SEC69
# Consistent BackSpace and Delete Configuration:
# http://www.ibb.net/~anne/keyboard.html
# Setup some default paths. Note that this order will allow user installed
# software to override 'system' software
# If you wish to change the path for all users, it is recommended you edit
# /etc/bash.bashrc
# If you wish to change the path on a user by user basis, it is recommended
you
# edit ~/.bashrc
PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
export PATH
MANPATH="/usr/man:/usr/local/man:/usr/autotool/devel/man:$MANPATH"
export MANPATH
# Set the user id
USER="`id -un`"
export USER
# Here is how HOME is set, in order of priority, when starting from Windows
# 1) From existing HOME in the Windows environment, translated to a Posix
path
# 2) from /etc/passwd, if there is an entry with a non empty directory
field
# 3) from HOMEDRIVE/HOMEPATH
# 4) / (root)
# If the home directory doesn't exist, create it.
if [ ! -d "$HOME" ]; then
mkdir -p "$HOME"
# copy skeleton files
cd /etc/skel
for f in `/bin/find . -type f`; do
fDest=`echo $f | sed -e 's/^\.//g'`
if [ ! -e "$HOME$fDest" -a ! -L "$HOME$fDest" ]; then
cp "$f" "$HOME/$fDest"
fi
done
fi
# Run all of the profile.d scripts
# Note that these are supplied by separate packages
for i in /etc/profile.d/*.sh ; do
if [ -f $i ]; then
. $i
fi
done
# Default to unix make mode
MAKE_MODE=unix
export MAKE_MODE
# It is recommended that cvs uses ssh for it's remote shell environment
CVS_RSH=/bin/ssh
export CVS_RSH
# Patches to Cygwin always appreciated ;)
# CVSROOT=:pserver:anoncvs@sources.redhat.com:/cvs/src
# export CVSROOT
# Shell dependent settings
case "$0" in
bash | -bash | */bash | \
bash.exe | -bash.exe | */bash.exe )
# Set a HOSTNAME variable
HOSTNAME=`hostname`
export HOSTNAME
# Set a default prompt of: user@host and current_directory
PS1='\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ '
;;
ksh* | -ksh* | */ksh* | \
ksh*.exe | -ksh*.exe | */ksh*.exe )
# Set a HOSTNAME variable
typeset -l HOSTNAME
# Set a default prompt of: user@host and current_directory
PS1='^[]0;${PWD}^G
^[[32m${USER}@${HOSTNAME} ^[[33m${PWD}^[[0m
$ '
;;
sh | -sh | */sh \
sh.exe | -sh.exe | */sh.exe )
# Set a simple prompt
PS1='$ '
;;
* )
echo "Sorry, this shell has no default setup."
echo "Please contact cygwin@cygwin.com with the shell details"
echo "and what you would like set as reasonable defaults."
echo
echo "Thanks"
echo
PS1='$ '
;;
esac
export PS1
# Uncomment to use the terminal colours set in DIR_COLOR
# eval `dircolors -b /etc/DIR_COLOR`
# Default to removing the write permission for group and other
# (files normally created with mode 777 become 755; files created with
# mode 666 become 644)
umask 022
# Make sure we start in home
cd "$HOME"
--
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/