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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=jWHXh2qvjH+R4cNH
	Qc5IfbeGZK0O9ICAe1y7zTYJ5Zi+ocmdH9h0k+J7tFkuy8Etv6MrXgzYCZyO9Y1l
	hNt9JaAHOC9ZjzcG2lAYuVM16cnVdc066SctGlOtJNnqgyoTVL867LGEoiARGiFH
	eFI+NmLbIE6ChrrEfE3MgRYkYZI=
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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=Hb2vHF5Wltdk2+tDSIqYhl
	f4B2I=; b=hCEIuLJVfDONOsrKDdGvweAJ9iDHJ3mf9KfvDaCrFUP2YSFJ7Dnk4g
	xPgGJqNOK63UheKST6Y4uy3DTLVxxEaOZ3L/vwhXFcXsTcs9wsDKgvS0nr2vYATg
	AKLbs79SB6nfgCm2zrmJ3+j9nF8Tus1evjf57dPJIKWcJy9rVoGiA=
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: Yes, score=6.0 required=5.0 tests=AWL,BAYES_80,FREEMAIL_FROM,HELO_LH_HOME,KAM_THEBAT,RDNS_NONE autolearn=no version=3.3.2
X-HELO: smtp.ht-systems.ru
Date: Wed, 25 Sep 2013 21:16:40 +0400
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: Andrey Repin <cygwin@cygwin.com>
Message-ID: <1296293740.20130925211640@mtu-net.ru>
To: Ulrich Pogson <grapplerulrich@gmail.com>, cygwin@cygwin.com
Subject: Re: Run bash script in cmd with cygwin
In-Reply-To: <CACOaVDt1UgN2X5XkHf4HcGB2gQQqLKD3QcHZiY5gnpeciCarnA@mail.gmail.com>
References: <CACOaVDt1UgN2X5XkHf4HcGB2gQQqLKD3QcHZiY5gnpeciCarnA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Ulrich Pogson!

> I would like to run this script `for file in `find . -name "*.po"` ;
> do msgfmt -o ${file/.po/.mo} $file ; done` in windows cmd.

I think you mean "command line" and not a "script".
This is not realistically possible. Windows CMD do not have as straightforward
quoting and escaping rules, as you might wish for it to have.
Your only safe bet is to actually write a script and execute it from cmd, when
need.

> The script need to run in a different folder. I have been able to run it
> though cygwin but want to integrate it with another system where it will be
> run through cmd.

> C:\cygwin\bin
> D:\path\to\dir

> How can I do this?

The association:

FTYPE unixshell.script="%CygwinDir%\bin\env.exe" "%1" %*
ASSOC .sh=unixshell.script

then your find-poo.sh

#! /bin/sh
for file in $(find . -name "*.po")
  do msgfmt -o ${file/.po/.mo} $file
done


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 25.09.2013, <21:05>

Sorry for my terrible english...


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

