delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/22/12:56:37

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
Message-ID: <3EA577EB.8040801@kegel.com>
Date: Tue, 22 Apr 2003 10:12:11 -0700
From: Dan Kegel <dank AT kegel DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313
X-Accept-Language: de-de, en
MIME-Version: 1.0
To: tek1 <tek1 AT pobox DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: beginner question: using 'set VAR=...'
References: <4 DOT 3 DOT 2-J DOT 20030422114455 DOT 033ca448 AT smtp DOT comcast DOT net>
In-Reply-To: <4.3.2-J.20030422114455.033ca448@smtp.comcast.net>

tek1 wrote:
> Because I only want them on occasion.  I would like to be able to 
> execute the script (.bat or .sh) and have the environment variables 
> defined in the script available during that particular session...

What kind of session are you talking about?  If it's a wcmd
session, the .bat file settings should indeed persist.
If it's a shell session, then you need to source (not run)
a shell script to get persistant settings.  In bash, the
command to source a script is '.', e.g.
   . foo.sh
Any variables set in foo.sh will then persist in the current
shell session (and any sessions it spawns).

Methinks tek1 needs to get more familiar with how Unix
environment variables work... I have a few shell tutorials
at http://www.kegel.com/linux/training.html, maybe one
of them would help.
- Dan


-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019