delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/04/29/04:16:28

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.5 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <49F80CC5.2010000@bodz.net>
Date: Wed, 29 Apr 2009 16:16:05 +0800
From: Lenik <lenik AT bodz DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Cygwin default path, or system-wide environment?
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

Here I means when running bash or other shell in non-interactive mode, 
how can I set up environment variables, and without touch the Win32 
System Environment?

     Default PATH, for example. When PATH variable isn't set, there is a 
default PATH. But if you set the PATH variable, the default PATH is 
gone, and then you must add the x:\cygwin\bin to the PATH manually.

     C:\Profiles\Shecti>path
     
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\cygwin\bin

     C:\Profiles\Shecti>bash -c "echo $PATH"
     
/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/usr/bin

     C:\Profiles\Shecti>set PATH=

     C:\Profiles\Shecti>c:\cygwin\bin\bash -c "echo $PATH"
     /usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.

     Well, it seems just fine, but NO, THERE IS A BIG PROBLEM, because 
not everyone have a clean OS, some of them have already installed a 
cygwin, but in different versions. I found that cygwin-1.7 is very 
suitable to deploy, because cygwin-1.7 supports fstab, so you don't have 
to trick with the Win32 Registry any more, you just config the 
etc/fstab, different cygwins will have their different mount points and 
won't bother each other at all.  But if I must include a specific 
version of cygwin\bin in the PATH, then this co-existence is break.


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