This is the mail archive of the cygwin 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]

Patch to /etc/profile to deal with $HOME with a space


I have just set up Cygwin, and noticed that my default home was under my
"Documents and Settings" directory (not yet having run mkpasswd). However,
the /etc/profile setup which tries to only create the warning message
about running mkpasswd and mkgroup once can't deal with a HOME environment
variable with a space in it. Here is a patch to allow that to work:

--- /etc/profile    2004-11-26 14:53:34.477082000 -0500
+++ /etc/profile    2004-11-30 11:22:32.175340300 -0500
@@ -194,10 +194,10 @@
   echo "and can be safely ignored."

   # only display the above once
-  cp -f /etc/group ${HOME}/group.mkgroup_l_d \
+  cp -f /etc/group "${HOME}/group.mkgroup_l_d" \
   && ( [ -w /etc/group ] || chmod --silent a+w /etc/group ; )\
-  && sed -e 's/^mkgroup_l_d/mkgroup-l-d/' ${HOME}/group.mkgroup_l_d > /etc/grou
p \
+  && sed -e 's/^mkgroup_l_d/mkgroup-l-d/' "${HOME}/group.mkgroup_l_d" > /etc/gr
oup \
   && chmod --silent --reference=/etc/passwd /etc/group
-  rm -f ${HOME}/group.mkgroup_l_d
+  rm -f "${HOME}/group.mkgroup_l_d"
   ;;
 esac

			Bill Knox
			Lead Operating Systems Programmer/Analyst
			The MITRE Corporation

--
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]