Handling of /etc/profile.d broken?

Jan Schormann Jan.Schormann@BrainLAB.com
Mon May 3 08:19:00 GMT 2004


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: profile.patch
Type: application/octet-stream
Size: 389 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20040503/8386b326/attachment.obj>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list