Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 Subject: Recover the original dos PATH within cygwin Date: Thu, 16 Oct 2003 10:34:28 +0200 Lines: 28 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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/