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.

Attachment: profile.patch
Description: Binary data

--
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/

Reply via email to