X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <47E94189.6FB1BC9F@dessent.net> Date: Tue, 25 Mar 2008 11:16:41 -0700 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Remove Cygwin Path for Called Batch Script References: <47E8FE86 DOT 9020405 AT hdfgroup DOT org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Note-from-DJ: This may be spam Scott Wegner wrote: > My question is, whether there is a way to easily strip the Cygwin > entries from the path for the batch call. Hopefully the solution would > be portable, and not affect the environment outside of the bash script. PATH is just a regular variable like any other. If you want to remove something from it, use whatever text processing tool you like. The shell lets you set environment variables only for the command being executed using the syntax "var=value command arg ...", so: PATH=$(perl -e 'print join(":", grep(!m@^/(usr/)?bin@, split(":", $ENV{PATH})))') cmd.exe /k batch-script.bat params Brian -- 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/