| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Reply-To: | <cygwin AT cygwin DOT com> |
| From: | "Ross Boulet" <ross AT rossb DOT com> |
| To: | <cygwin AT cygwin DOT com> |
| Subject: | RE: Handling of /etc/profile.d broken? |
| Date: | Mon, 3 May 2004 11:58:59 -0500 |
| Message-ID: | <001801c4312f$f2e367f0$6501a8c0@RossLap> |
| MIME-Version: | 1.0 |
| In-Reply-To: | <KCEOLMMHICICJKHPFOALAEDGCDAA.Jan.Schormann@BrainLAB.com> |
| X-IsSubscribed: | yes |
| X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id i43H1VRa017795 |
> Hi,
>
> I've just noticed a weird problem:
> When I set an environment variable in a script in
> /etc/profile.d, I never see it in my shell.
> For example, take
>
> ---- /etc/profile.d/blub.sh:
> export blub=1
> ----
>
> Adding "echo $blub" to the loop in /etc/profile,
> I can see that it gets set, but is unset immediately
> after the loop.
>
> The attached patch changes the loop from the
> "find ... | while ..." idiom to "for f in `find ...` ...",
> and that works.
>
> Is it true that the "|" starts a new sub-shell, which
> makes all the "export" commands and the use of the
> "source" (".") obsolete? What a pity.
>
> I wonder whether it has been like that all the time,
> and I'm the only one who's so stupid as to try and set
> environment variables in /etc/profile.d?
>
> Funny world ;-) Any hints?
>
> Best wishes,
> Jan.
WFM under both bash and pdksh.
--
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |