X-Recipient: archive-cygwin@delorie.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:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 q=dns; s=default; b=iZjHJzda92dPsrV0ZA9kNOF3MpOu408ZwzeZpGjKJL9
	lLaZ2PyAeF3aRZ4KPqTJ3DvZDixZsL0IClakcLCZHDDF5o+bbQWW9T53smDtpcFs
	Tort6G1xFImUDEpk5H0+RabX5X7TNC/EjmYrSLGHkJwp4853wfB4RFGolwa9X5ZY
	=
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:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 s=default; bh=pDlRTrDp8OPIsyhaqTXwtCoEVuQ=; b=BxMtW19jtbZzjc7Qb
	QxjSOUy8lTLz2IU44qrCEXR402JphFzv86+kQAbHcknyGaebK3ojJlEa6C1Xn9BL
	fysxbSj3lOGKbuu6YEgV1IVieN0QPTmIXdO3IjyguO3DmXEW0LN42s8QQoseB/2w
	xlLbETK2gNhzy4ReK+fiLGa+VQ=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: Ishtar.hs.tlinx.org
Message-ID: <548E1681.7040506@tlinx.org>
Date: Sun, 14 Dec 2014 15:00:17 -0800
From: Linda Walsh <cygwin@tlinx.org>
User-Agent: Thunderbird
MIME-Version: 1.0
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: a batch that executes a command within cygwin?
References: <611194532.436042.1418561147642.JavaMail.yahoo@jws11167.mail.ir2.yahoo.com> <548D8B94.4030701@gmail.com>
In-Reply-To: <548D8B94.4030701@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Marco Atzeri wrote:
> 
> 
> On 12/14/2014 1:45 PM, Marilo wrote:
>> I would like to make a batch file that executes a command within cygwin.
>>
>> or tells cygwin to execute some commands when it starts.
>>
>>
>> I know I can do
>> C:\cygwin\bin>nc<ENTER>   <--- And that works
>>
>> but it doesn't run the nc command.

Try (in bash):

cd /tmp

cat >/tmp/runmc <<'EOF'
#!/bin/bash
PATH="/bin:/sbin:/usr/local/bin:$PATH"
nc
EOF

chmod +x /tmp/runmc

##in Windows (like cmd.exe, you can run it like:...

/tmp> cmd
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
C:\tmp>C:\bin\bash /tmp/runmc
C:\bin\bash /tmp/runmc
usage: nc [-46CDdhklnrtUuvz] [-I length] [-i interval] [-O length]
     [-P proxy_username] [-p source_port] [-s source] [-T ToS]
     [-V rtable] [-w timeout] [-X proxy_protocol]
     [-x proxy_address[:port]] [destination] [port]



>>
>> I'm interested in running a command (nc for example) within cygwin.
---
Maybe the above will get you started?

(you may have to adjust paths .. my cygwin is
installed in root (sorta), so I don't need to add
cygwin to my dos paths...)



--
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

