delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/12/14/18:00:44

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: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 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
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 AT tlinx DOT org>
User-Agent: Thunderbird
MIME-Version: 1.0
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: a batch that executes a command within cygwin?
References: <611194532 DOT 436042 DOT 1418561147642 DOT JavaMail DOT yahoo AT jws11167 DOT mail DOT ir2 DOT yahoo DOT com> <548D8B94 DOT 4030701 AT gmail DOT com>
In-Reply-To: <548D8B94.4030701@gmail.com>
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

- Raw text -


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