| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-Spam-Check-By: | sourceware.org |
| To: | cygwin AT cygwin DOT com |
| From: | "Michael Kairys" <kairys AT comcast DOT net> |
| Subject: | Re: Remove Cygwin Path for Called Batch Script |
| Date: | Tue, 25 Mar 2008 12:37:58 -0400 |
| Lines: | 23 |
| Message-ID: | <fsb9ov$cnn$1@ger.gmane.org> |
| References: | <47E8FE86 DOT 9020405 AT hdfgroup DOT org> <47E90794 DOT 3010406 AT sbcglobal DOT net> <47E909C3 DOT 3010408 AT hdfgroup DOT org> |
| Mime-Version: | 1.0 |
| In-Reply-To: | <47E909C3.3010408@hdfgroup.org> |
| X-IsSubscribed: | yes |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 |
| Note-from-DJ: | This may be spam |
"Scott Wegner" <swegner AT hdfgroup DOT org> wrote in message
news:47E909C3 DOT 3010408 AT hdfgroup DOT org...
> ... However, I'd rather find a solution where the batch script can remain
> "unaware" of its Cygwin context. Once I get things working, I plan on
> creating bash script wrappers for many Windows batch scripts, so I'd like
> to make the changes in the Cygwin environment, rather than editing each
> batch script individually.
What I do is have a batch file I call before executing any dos commands
(sort of a ".dosrc"), and in that I set my dos path. So for example I have a
bash function "dos" that looks like this:
function dos() { local s=/c; if [ "$1" == "" ]; then s=/k; fi; cmd $s
"%ETC%\login &" $*; }
... where %ETC%\login.bat is my ".dosrc" file. This enables me to say to
bash, "dos" and get a dos prompt, or "dos foo" and execute foo in a dos
context. LIkewise for things such as shortcuts to cmd.exe, I use "cmd.exe /k
%ETC%\login".
I know this is not exactly what you're looking to do but perhaps something
similar might work in your case.
--
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |