delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/11/05/03:19:38

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:mime-version:from:date:message-id:subject:to
:content-type; q=dns; s=default; b=jMnrQAu6VrfKASOyh9/7S/dU0asBh
vBsAX68g7Kkc8VYledP0SVkE0tKwz6JxgMmx7AVhslIrSKeY4PSYY9vMn1oaE5zl
3zzxNrycEGH3nx+nVqqTLlV94AjD1kQebTfi2u9hHA2Hc+pnaOz1HppvuABAc6Id
W4G6pfeXY0P+sY=
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:mime-version:from:date:message-id:subject:to
:content-type; s=default; bh=XV3lABdy0ePs9p9aK/dOsV1Ifrw=; b=x6t
Y4CN8vWKvqIge5i3OFjqhdC5GVjUCwjZKBl0mkqXFwMAZWiXRL8rBg76pKXiUfb7
6zeyQuiC6xj1D+hCCy5Uoz5U74/3RK/zMic2IIOKAN0CrEUbN4jOw2BcAwgutk5+
nlmao80RltfONyh9HzIUwWRxv/MryEBBS+x32kuE=
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=0.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-wg0-f41.google.com
X-Received: by 10.194.63.229 with SMTP id j5mr63237126wjs.23.1415175554910; Wed, 05 Nov 2014 00:19:14 -0800 (PST)
MIME-Version: 1.0
From: Kal Sze <swordangel AT gmail DOT com>
Date: Wed, 5 Nov 2014 16:18:34 +0800
Message-ID: <CAGZiy731mOGON-Bhd9XYZo-8jQ0WrLKOioxKBGnJrZbDprGvPg@mail.gmail.com>
Subject: Running non-cygwin executables in cygwin bash terminal or script
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

Hello,

In general, is there anything that can go wrong or not work if I
invoke regular Windows/.NET executables (not compiled with any cygwin
header or linked with any cygwin dll) from a cygwin bash terminal or
script?

I am planning to write a bash script to call rsync and then a command
line program written in C# (.NET framework 4.5 in Visual Studio 2013).

I'm not a huge cygwin/posix/unix hacker, so there are a few things
that seem murky. I suppose that are other people in similar
situations.

I can think of a few things that don't seem entirely clear in the
documentation and FAQ.

I'm guessing that invoking regular Windows/.NET executables would
mostly just work, with the following caveat:
- stdin/stdout/stderr redirection and piping would still work, even
when piping with cygwin-linked programs (care with charset and
end-of-line conventions needs to be taken, however);
- UNIX-style sockets are out of the question;
- the usual Window permission model would still be used;
- if the regular Windows/.NET executable accepts a file or directory
path as argument, it still needs to be written in the Windows style
(i.e. "C:\\foobar\\" instead of "/cygdrive/c/foobar");
- the locale of the cygwin bash process may cause problems when
passing arguments to the regular Windows program.

Am I mostly correct? So far it seems to work. Am I missing other caveat?

Would it make sense to have all this summarized in the FAQ?

Best Regards,
Kal

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