delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/08/12/10:33:21

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; q=dns; s=default; b=rL
rDSOWnNwifL8TSqddEkAMeHoFrt1BHXTqcFaP+v385+IfodJ2YBn3JmuCs9q8xks
xe5hwNdhh/Avz4F1nZA9nLtlIqlblCsIVNQVTHO0Q33IAvgPaMkW3F7mkqxAnRlZ
kX8I5iDEgY5X3rxHVYRWWBPe8wF0nZ6XpdkhM5JcA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; s=default; bh=ehhGXzrx
gcTOejdcDigPgMefzY0=; b=JnakwAB3VzaSWO2rsdxS0phURHAJFVclSXMQJfBK
JcX53eNpaUB4hi/18F2TpE1jGN/2iLyxOWcDnnBRGe2XhWh7x3+l6ctL/lSp+qBP
NynMyI2SZfs/Cdq2/NYE+tzvcBMX98FyOxfogX6qmS8Pl1Pe0lBcuAVAzwRnCg4z
6v0=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.2
MIME-Version: 1.0
X-Received: by 10.229.206.70 with SMTP id ft6mr5827685qcb.88.1376317980672; Mon, 12 Aug 2013 07:33:00 -0700 (PDT)
In-Reply-To: <CAEhDDbBvppt2o5g1rpyCpxva7sga-bhkEPctoa8nau=pX0Btqw@mail.gmail.com>
References: <DUB123-W29CB87179CAE6145C437BBB1580 AT phx DOT gbl> <CAEhDDbBvppt2o5g1rpyCpxva7sga-bhkEPctoa8nau=pX0Btqw AT mail DOT gmail DOT com>
Date: Mon, 12 Aug 2013 10:33:00 -0400
Message-ID: <CA+sc5mmbjWYwSk2O+HgfN=_taz7ApUxVzv3EXcWfX5Ua1Nf=Xg@mail.gmail.com>
Subject: Re: Source a .bat file from bash
From: Earnie Boyd <earnie AT users DOT sourceforge DOT net>
To: cygwin AT cygwin DOT com

On Mon, Aug 12, 2013 at 4:18 AM, Csaba Raduly <rcsaba AT gmail DOT com> wrote:
> Hi Saurabh,
>
> On Fri, Aug 9, 2013 at 10:42 PM, Saurabh T wrote:
>> Is there a way to source a .bat file from bash and have the paths and other environment variables set in it apply in cygwin?
>>
>
> Note that "to source" in UNIX shell parlance means "read the file and
> interpret it". Bash can't do that with a .bat file (it's in a
> different language).
>

That is only half true.  I have and a little success with bash reading
a .bat file but you must obey the rules of bash syntax or overcome it
and vice versa.  Tedious at best.

> You could run cmd.exe to interpret the .bat file, but changes to th
> environment get lost when cmd.exe exits. One possibility is to run
> bash from the cmd.exe window after the batch has finished.
>

Or just start a Cygwin shell from the .bat file.  That child of the
.bat file would contain the environment from the parent but the parent
cannot receive the environment of the child.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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