From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6031 invoked by alias); 21 Aug 2012 12:07:54 -0000 Received: (qmail 6017 invoked by uid 22791); 21 Aug 2012 12:07:52 -0000 X-SWARE-Spam-Status: No, hits=-10.4 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Aug 2012 12:07:33 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7LC7XiH002803 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 Aug 2012 08:07:33 -0400 Received: from [10.3.113.100] (ovpn-113-100.phx2.redhat.com [10.3.113.100]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7LC7ViJ000809 for ; Tue, 21 Aug 2012 08:07:31 -0400 Message-ID: <50337A02.8070809@redhat.com> Date: Tue, 21 Aug 2012 15:35:00 -0000 From: Eric Blake User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: /etc/profile References: In-Reply-To: OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig10DBDEAA3BBB241DB9991D75" X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-08/txt/msg00492.txt.bz2 --------------enig10DBDEAA3BBB241DB9991D75 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 2053 On 08/21/2012 04:16 AM, Achim Gratz wrote: > I'm removing the Windows PATH in my startup scripts since there's nothing= in > there that I think should be accessible from Cygwin. Unfortunately, at least your windows system dll directory has to be on PATH, or cygwin1.dll will fail to load, so blindly removing ALL windows paths from PATH is wrong. > 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 ag= ainst a > missing or non-cdable /etc/skel). A missing /etc/skel is a sign of mis-installation, but extra guards won't hurt, I guess. But you are wrong about the LC_COLLATE command having no effect. Remember, the shell is required to expand globbing prior to executing a command, but that LC_COLLATE affects how globbing is performed. Therefore, you MUST separate the assignment from LC_COLLATE from the globbing, if the globbing is to be affected (for that matter, if LC_ALL is set, then it overrides LC_COLLATE, so it may be better to patch this particular usage to set LC_ALL instead of LC_COLLATE). > @@ -103,7 +107,7 @@ > # Shell dependent settings > profile_d () > { > - for file in $(export LC_COLLATE=3DC; echo /etc/profile.d/*.$1); do > + for file in $(LC_COLLATE=3DC echo /etc/profile.d/*.$1); do Given my above arguments, if this changes at all, it should change to: for file in $(LC_ALL=3DC; echo /etc/profile.d/*.$1); do but that is not safe for files containing whitespace. If you want safety, then we should avoid the $() and use globbing directly, although it gets much longer with something like this: saved_LC_ALL=3D$LC_ALL set_LC_ALL=3D${LC_ALL+set} LC_ALL=3DC for file in /etc/profile.d/*.$1; do if test $set_LC_ALL LC_ALL=3D$saved_LC_ALL else unset LC_ALL fi # original loop body done if test $set_LC_ALL LC_ALL=3D$saved_LC_ALL else unset LC_ALL fi unset saved_LC_ALL set_LC_ALL --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig10DBDEAA3BBB241DB9991D75 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 620 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQM3oDAAoJEKeha0olJ0NqnM4H/RgASLPdX5vQpqcMXHwzzsfZ GNi3ZbBrtwwBvFkolr9LJibevyfbUMw6XtBvh+5cJg0hcs0f3EqcPNYACjd27vUI FQT/RIpJBWR4gySY9ATbiC5FPKXlAKYEjDKfZwRvz8adXaytkYkyEkwLLzFrpywn lFYRENDhXxcCLVGsn0U23R/3EI2YbAZiK0/H34/zeW6LN41hmOBRuWkcRX491A6A Ax+O7lZfoHdFUSIVU0BwbyAnT+fHcn/BhOQ2VBS1ITPa4BBqc7m7m05L6bTvDYDX ZAeGrKQbDuw9hwBdHmEbbNmY3lUVyfI9Rn44jNxCyUnBy5XXMgmQmKfTZDvNQDs= =ux9c -----END PGP SIGNATURE----- --------------enig10DBDEAA3BBB241DB9991D75--