Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com Message-ID: <3E5512A3.B7A9D1B6@doe.carleton.ca> Date: Thu, 20 Feb 2003 12:38:43 -0500 From: Shing-Fat Fred Ma X-Accept-Language: en MIME-Version: 1.0 To: Bob McGowan CC: cygwin@cygwin.com Subject: Re: Question re. export environment variable References: <3E550005.84B691EA@doe.carleton.ca> <3E550957.1070306@veritas.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Thanks, Bob. That's the way I expected it to work. I was just unsure of whether there was something cygwin-specific, as it seems strange that something like HOSTNAME is not marked for export at the time that it is set. I'll stick it into ~/.bashrc. Fred -- Fred Ma, fma@doe.carleton.ca Carleton University, Dept. of Electronics 1125 Colonel By Drive, Ottawa, Ontario Canada, K1S 5B6 Bob McGowan wrote: > Fred, perhaps this will help: > > echo $TEST # Test has no value, hence the blank line. > > $ TEST=noexport # Set but not exported > $ echo $TEST > noexport > $ env|grep TEST # Nothing found, no output. > $ export TEST # Export it. > $ env|grep TEST # And now it's found in the environment. > TEST=noexport > $ TEST=second # Change its value. > $ env|grep TEST # Same search as above, but the value is changed. > TEST=second > > Perhaps the easiest way to look at it is to think of exporting as making a type > of global variable. Everyone (within certain limits; for the shell, only its > children...) will see the exported variable. If the value changes, it changes > "everywhere". I've quoted everywhere because this only applies to children > invoked after the change. So if TEST=second and you run an xterm, the new shell > sees TEST=second. Change TEST=third in the first shell, you still have > TEST=second in the second shell, since it already got its value for TEST. Start > a third shell from the first, it will see TEST=third. And so on. > > Fred Ma wrote: > > Hello, > > > > I'm using cygwin bash 2.05b-8 (it's actually gnu). > > I thought that $HOSTNAME was an environment > > variable. When I run gnu make (I'm pretty > > sure this is not a make problem), $(HOSTNAME) > > is empty. It gets fixed if I do "export HOSTNAME" > > before running make. > > > > Is there a way to check if the export command > > has been applied to $HOSTNAME? Does the > > actual transcription of $HOSTNAME's value to > > the environment happen only once, when > > "export" is applied, or is there a continual > > monitoring an mirroring of changes to $HOSTNAME > > forever after applying "export"? > > -- > Bob McGowan > Staff Development Engineer > VERITAS Software > rmcgowan@veritas.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/