From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23517 invoked by alias); 7 Nov 2014 21:48:22 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 23495 invoked by uid 89); 7 Nov 2014 21:48:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f43.google.com Received: from mail-oi0-f43.google.com (HELO mail-oi0-f43.google.com) (209.85.218.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 07 Nov 2014 21:48:20 +0000 Received: by mail-oi0-f43.google.com with SMTP id e131so3060193oig.30 for ; Fri, 07 Nov 2014 13:48:18 -0800 (PST) X-Received: by 10.182.102.37 with SMTP id fl5mr12058755obb.24.1415396898340; Fri, 07 Nov 2014 13:48:18 -0800 (PST) Received: from [10.192.4.62] (67-198-47-100.static.grandenetworks.net. [67.198.47.100]) by mx.google.com with ESMTPSA id p132sm4199408oif.4.2014.11.07.13.48.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Nov 2014 13:48:17 -0800 (PST) Message-ID: <545D3E21.2030306@bopp.net> Date: Fri, 07 Nov 2014 21:48:00 -0000 From: Jeremy Bopp User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: how to embed shell script within a .BAT file References: <0D835E9B9CD07F40A48423F80D3B5A702E8379F0@USA7109MB022.na.xerox.net> In-Reply-To: <0D835E9B9CD07F40A48423F80D3B5A702E8379F0@USA7109MB022.na.xerox.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00147.txt.bz2 On 11/07/2014 03:26 PM, Nellis, Kenneth wrote: > I'm tired of creating pairs of script files: a clickable .BAT file > to invoke my shell script and then my shell script to do the actual > work. I was wondering if any of the geniuses on this list have come > up with a way to embed a shell script inside a clickable .BAT file. Something like this might do. It assumes you know the path to the Cygwin bin directory. Passing in arguments would be a bit more work and would probably be somewhat limited unless you have a small number of possible arguments. FYI, I don't have a Windows system readily available anymore, so this is untested. Shelly.bat: @echo off rem Put Cygwin bin directory into PATH set PATH=C:\cygwin\bin;%PATH% type %0 | sed "0,/^---BASH SCRIPT FOLLOWS---/ d; s/\r*$//" | bash goto :eof ---BASH SCRIPT FOLLOWS--- echo $SHELL is alive ^Z -Jeremy -- 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