a batch that executes a command within cygwin?
Linda Walsh
cygwin@tlinx.org
Sun Dec 14 23:00:00 GMT 2014
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
More information about the Cygwin
mailing list