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=D9 QAiqBas/GRx7Vijx2CF6bbmS2SAqT2U3rOLHScMPCBYfljb0L7wWojaKhpccQG07 UJtBXFytbh3rv4hEd+ZgYgH4m1CviK9NHGhBuEnzQMVMsPZx1P737VIOJIvEZtlm DIyTLWifhRJT/sA+N7ZW9MN0hsu/FFs5ZQ3pJTDgc= 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=Zjh51wxE 0qWGrvFftraNV8oozfk=; b=Gexm/q3iuQE6OLoW2f4l1jt467jILYUDuyenQ1U5 zQ70opfWnFfA6MiJLx51OtNcTkbHA04GYadGkja4VqBOIEsqv+tL83HkeQWQNd7V Co7eWOuwjI6bwGXwe/OAcpG/yu6M1GPR5DfOM1kj0GUVpNzivEFhKrRSbu83OUbM Dw0= 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 X-Spam-SWARE-Status: No, score=-3.0 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.180.13.83 with SMTP id f19mr5817765wic.54.1376295490584; Mon, 12 Aug 2013 01:18:10 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Aug 2013 10:18:10 +0200 Message-ID: Subject: Re: Source a .bat file from bash From: Csaba Raduly To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 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). 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. some_command could be: cp $1 /tmp/bat-to-bash-$1 echo 'c:\cygwin\bin\bash.exe --login' >> /tmp/bat-to-bash-$1 cmd.exe /tmp/bat-to-bash-$1 (this might work, but I haven't tested it) Csaba -- GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++ The Tao of math: The numbers you can count are not the real numbers. Life is complex, with real and imaginary parts. "Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds "People disagree with me. I just ignore them." -- Linus Torvalds -- 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