X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: [ANNOUNCEMENT] Updated [experimental]: bash-3.1-7 Date: Mon, 11 Sep 2006 22:13:15 +0000 (UTC) Lines: 46 Message-ID: References: <20060911180903 DOT GA21327 AT trixie DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com mwoehlke tibco.com> writes: > >> > >> So $HOME is being set wrong. "echo $HOME | od -c" gives " / h o m > >> e / m w o e h l k e \r \n". "echo %HOME%" from a > >> fresh cmd.exe gives "C:/Documents and Settings/mwoehlke". I ran d2u on > >> /etc/profile, /etc/default/etc/profile and /etc/passwd. I can't reproduce this. Have you tried 'bash -lvx' for a verbose trace, to see if some text-mode file is being sourced very early in your edited /etc/profile which does HOME=/home/mwoehlke? The fact that Windows %HOME% is defined differently than what you want in cygwin makes it seem like you are doing something in /etc/profile to override what cygwin would normally do for $HOME. What does 'env' say HOME is when invoked from cmd.exe? I would expect it to be a POSIX-translation of %HOME%, rather than /home/mwoelke\r, and that would be confirmation that something in (or called by) /etc/profile is the culprit. Also, I would recommend "echo $HOME- | od -c", so that you can distinguish between any \r actually in $HOME and ensure that echo is not outputting in text mode to the pipe. > No... > > I ran d2u on /etc/profile, /etc/default/etc/profile and /etc/passwd. > > Besides, $HOME is colon-separated, with data after it, so even if it > does/did, it seems like something else would be going wrong if this > caused $HOME to have a '\r' on the end. According to /etc/defaults/etc/profile, in the algorithm for setting $HOME, /etc/passwd is option 2, only used if %HOME% doesn't exist in the Windows environment as option 1. > POSIXLY_CORRECT = '1' <-- what is setting this, and why? That is being set by cygcheck, just before invoking external programs. It probably had something to do with forcing external programs to not rearrange option arguments (for example, "ls foo --all" treats --all as an option, but "POSIXLY_CORRECT=1 ls foo --all" treats --all as a filename). But I think it is possible to get along without doing it (repeating the example, "ls -- foo --all" treats --all as a filename), and I personally think that cygcheck should be patched to QUIT setting POSIXLY_CORRECT, so that we can tell the masochists apart from normal users. -- Eric Blake -- 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/