This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Handling of /etc/profile.d broken?
- From: "Ross Boulet" <ross at rossb dot com>
- To: <cygwin at cygwin dot com>
- Date: Mon, 3 May 2004 11:58:59 -0500
- Subject: RE: Handling of /etc/profile.d broken?
- Reply-to: <cygwin at cygwin dot com>
> 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/