delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/08/09/16:43:05

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:message-id:from:to:subject:date:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=wNa
Fvpm0pvzYe4eY2AO1AZTwF1sPLRCZsZfDWsrpAkkTH5ofaiEVtwc20d47H7xJNK6
RmhhjE+FlMgku+YlV5cDsVe+7QGVbDDcXNnf2JJ9HKL0yCBUfM3NmXV08QjXtYB1
eUfNcQ6rzQwA4z+2ceBH/fPQ+5MMyLdlBezNE5fQ=
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:message-id:from:to:subject:date:content-type
:content-transfer-encoding:mime-version; s=default; bh=BX//FXH5v
iw8Kq4ASLScl67JV/M=; b=ZhjjxqnhVqf3+j+zGtwnzq5wM0mia9Qpq59bXYKz1
SHwoRxnLOssFMPAiuycbNVHQI/QQcNHBEjfcF7EuOO8okzEGWIOeyrTI9vzOdahb
K/bbkdowIfu1kx+Wv/vMXMsdSV1nT7iw9dUBFtrtaI8+OBR6MEKP6RM6cvCMKoxy
X8=
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=-0.8 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=no version=3.3.1
X-TMN: [e+27htQ8ll+qVnebS6d5V0UeoLyXqQju]
Message-ID: <DUB123-W29CB87179CAE6145C437BBB1580@phx.gbl>
From: Saurabh T <saurabh AT hotmail DOT com>
To: Cygwin <cygwin AT cygwin DOT com>
Subject: Source a .bat file from bash
Date: Fri, 9 Aug 2013 20:42:38 +0000
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r79Kh0fX010172

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?

For example

$ echo $PATH
/usr/local/bin:/usr/bin

$ cat file.bat
set path=%path%;C:\windows\something
set x=somevar

$ some_command file.bat

$ echo $PATH
/usr/local/bin:/usr/bin:/cygdrive/c/windows/something   <- Expected

$ echo $x
somevar   <- Expected

Is this possible?

Thanks,
saurabh 		 	   		  
--
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