This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Run bash script in cmd with cygwin

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

> 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

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

Andrey Repin ( 25.09.2013, <21:05>

Sorry for my terrible english...

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]