delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/04/15:18:33

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3BBCB5D9.24B93D2C@windriver.com>
Date: Thu, 04 Oct 2001 12:17:45 -0700
From: Doru Carastan <doru DOT carastan AT windriver DOT com>
Organization: Wind River, Inc.
X-Mailer: Mozilla 4.78 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT sources DOT redhat DOT com
Subject: RE:system not working as expected

Jorge,

As everyone here agrees, the best way to do it is to make sure that /bin
is in your path. When you start from BASH your PATH has /bin, /usr/bin
and /usr/local/bin added by /etc/profile. When you start from Explorer
or a DOS prompt you have only the system environment PATH.

My suggestion is to adjust the path at runtime as part of your
application initialization code. The best way to do it is to check for
each of /bin, /usr/bin and /usr/local/bin directories and prepend them
to your process $PATH. The easy way is to simply prepend
"/usr/local/bin:/usr/bin:/bin:" to the value of $PATH. Read your process
$PATH using getenv() and set it with putenv(). Your child process will
inherit your settings.

Does anyone know why the man page for putenv is missing in Cygwin?

Doru C.

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

- Raw text -


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