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 Message-ID: <38320.12.22.157.254.1061853499.squirrel@mail3411.b0.com> Date: Mon, 25 Aug 2003 18:18:19 -0500 (CDT) Subject: BUG: base-files-2.2-1 profile.d runs in subshell - sourced files fail From: "mike808" To: , X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Reply-To: mike808 AT users DOT sourceforge DOT net MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In base-files-2.2-1, the following was recently changed: > # Run all of the profile.d scripts > # Note that these are supplied by separate packages > /bin/find /etc/profile.d -iname '*.sh' -type f | while read f; do > if [ -f "$f" ]; then > . "$f" > fi > done Previously, the find was executed as an expanded filename wildcard expansion as part of a 'for' loop. (c.f. 2.0-2) When this was changed to the current code, because a pipe is used, the subsequent commands run in a *sub-shell* of the parent /etc/profile script executing. This means that any environment changes performed by the files in /etc/profile.d/ are *lost* when the sub-shell returns to the parent. This effectively nullifies any environment changes being performed in those files. Things like PATH setting, etc. I use them to clean up environment variables mangled by Rational prior to setting up a shell in Cygwin. Please put it back to the way it was in base-files-2.0-2, with the one exception that quote marks be placed around the "$i" iterator variable so as to preserve any whitespace that might be in the filenames. I have corrected that working code (from 2.0-2) below: > # 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 Thank you. Michael/ -- 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/