This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: a batch that executes a command within cygwin?
- From: Linda Walsh <cygwin at tlinx dot org>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Sun, 14 Dec 2014 15:00:17 -0800
- Subject: Re: a batch that executes a command within cygwin?
- Authentication-results: sourceware.org; auth=none
- 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>
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