public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Trick cmd.exe of Windows XP to run cygwin Batch Script.
Date: Mon, 05 Jan 2009 12:43:00 -0000	[thread overview]
Message-ID: <9up3m4hudhdfrourtmnmsiust0bs8jq0l5@4ax.com> (raw)
In-Reply-To: <20090104110730.GH4017@trikaliotis.net>

On Sun, 4 Jan 2009 12:07:31 +0100, Spiro Trikaliotis
<an-cygwin@spiro.trikaliotis.net> wrote:
>d:\> bash -c ./myscript

I've tested the above code and work it out like this:

set cygwin_bin=C:\cygwin\bin
%cygwin_bin%\bash -l %~dp0myscript > myresult

In the above example by me,  we need to pay attention to the following
matters:

1- %~dp0myscript mean that the file myscript is located at the same
directory as the bat file, i.e, the batch file which include the above
patch codes I posted here.  This batch file will invoke the bash
script file myscript.

2- the -c parameter used by you shouldn't be used here, if I used it,
I will meet the errors like this:

... command not found

3- The --login or -l must be used here, otherewise the following error
will be occur like this:

myscript: line 1: awk : command not found

4- The path name conventions in the invoking of this batch file, the
dos rule, i.e., _\_,  should be used instead of the bash convention,
i.e., _/_, as the delimitor of path.

5- In your case,

>d:\> bash -c ./myscript

actully, in the usage, the file myscript must ba put into the bash's
directory, i.e., C:\cygwin\bin.  This is not a convenient solution.

Regards,

-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

      parent reply	other threads:[~2009-01-05 11:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-04 10:37 Hongyi Zhao
2009-01-04 11:07 ` Frank Fesevur
2009-01-04 13:09   ` Jeenu V
2009-01-05 11:27   ` Hongyi Zhao
2009-01-06 17:54     ` Frank Fesevur
2009-01-07  5:33       ` Jared Silva
2009-01-08 10:34       ` Hongyi Zhao
2009-01-04 17:10 ` Spiro Trikaliotis
2009-01-05 11:32   ` Hongyi Zhao
2009-01-05 16:34     ` Robert Pendell
2009-01-06 17:49       ` Hongyi Zhao
2009-01-05 12:43   ` Hongyi Zhao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9up3m4hudhdfrourtmnmsiust0bs8jq0l5@4ax.com \
    --to=hongyi.zhao@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).