Mail Archives: cygwin/2012/08/21/06:17:26
I'm removing the Windows PATH in my startup scripts since there's nothing in
there that I think should be accessible from Cygwin.
For (t)csh this is easy enough to do with dropping a script into /etc/profile.d
that gets executed first, but there's no such provision for sh and the ilk since
PATH is set up already before it get there. Now, unless profile gets changed I
can still cut off "/usr/local/bin:/usr/bin:" with a profile.d script, but I
think it might be preferrable that the Windows path gets recorded into
ORIGINAL_PATH or some similar name at the beginning of profile. It would then
be a simple matter to later add the Windows path where appropriate, but I don't
think the default path should have it at all.
Also, there are two things in profile that may admit slight improvement (a place
where LC_COLLATE is specified just for one command and better guarding against a
missing or non-cdable /etc/skel).
Patch:
--- /etc/defaults/etc/profile 2012-02-27 22:03:33.000000000 +0100
+++ /etc/profile 2012-08-21 12:12:42.617969800 +0200
@@ -29,7 +29,8 @@
# software to override 'system' software.
# Modifying these default path settings can be done in different ways.
# To learn more about startup files, refer to your shell's man page.
-PATH="/usr/local/bin:/usr/bin:${PATH}"
+ORIGINAL_PATH=$PATH
+PATH="/usr/local/bin:/usr/bin"
MANPATH="/usr/local/man:/usr/share/man:/usr/man:${MANPATH}"
INFOPATH="/usr/local/info:/usr/share/info:/usr/info:${INFOPATH}"
@@ -75,14 +76,17 @@
echo
echo "They will never be overwritten nor automatically updated."
echo
- cd /etc/skel || echo "WARNING: Failed attempt to cd into /etc/skel!"
- /usr/bin/find . -type f | while read f; do
- fDest=${f#.}
- if [ ! -e "${HOME}${fDest}" -a ! -L "${HOME}${fDest}" ]; then
- /usr/bin/install -D -p -v "${f}" "${HOME}/${fDest}"
- fi
- done
- unset fDest
+ if ! cd /etc/skel ; then
+ echo "WARNING: Failed attempt to cd into /etc/skel!"
+ else
+ /usr/bin/find . -type f | while read f; do
+ fDest=${f#.}
+ if [ ! -e "${HOME}${fDest}" -a ! -L "${HOME}${fDest}" ]; then
+ /usr/bin/install -D -p -v "${f}" "${HOME}/${fDest}"
+ fi
+ done
+ unset fDest
+ fi
else
echo "${HOME} could not be created."
{ [ -d "${TEMP}" ] && HOME="${TEMP}"; } ||
@@ -103,7 +107,7 @@
# Shell dependent settings
profile_d ()
{
- for file in $(export LC_COLLATE=C; echo /etc/profile.d/*.$1); do
+ for file in $(LC_COLLATE=C echo /etc/profile.d/*.$1); do
[ -e "${file}" ] && . "${file}"
done
unset file
Regards,
Achim.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -