delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/16/04:34:32

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
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin AT cygwin DOT com
From: Pietro Toniolo <ptoniolo AT tin DOT it>
Subject: Recover the original dos PATH within cygwin
Date: Thu, 16 Oct 2003 10:34:28 +0200
Lines: 28
Message-ID: <bmll6b$li3$1@sea.gmane.org>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007
X-Accept-Language: en-us, en

I use to have c:\cygwin\bin in my dos path, and I normally use cygwin
version of gawk to implement extensions to the w2k/dos command prompt. I
have written a "whence" utility that prints the full path of the
commands I put on the command line.

The problem is: the cygwin version of gawk does not have access to the
dos-version of the PATH variable, but only to the cygwin-adapted one
(/cygpath/c/... and so on). Thus I could not print out the dos-path of
the commands requested.

I found a solution, encapsulating the gawk call in a dos .cmd file, that
passes "%PATH%" along with the other parameters: my .awk file now uses
the path found in ARGV[1], instead of the ENVIRON one.

Is there a way to access the original dos PATH from a cygwin command? I
would like to have a copy of the dos path in a, say, PATH_DOS_SAVED
environment variable or something like. I think this should be a feature
offered by the architecture itself, kernel, shell or whatsoever.

BTW, when my dos-path variable ends with a backslash (sometimes the path
is modified by a new install), enclosing it in quotes makes a mess: the
closing quote is escaped! A saved path would solve this problem too.

Thank you
	Pietro Toniolo
	Milano, Italy




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