This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Calling bash shell from W2K batch script
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Jared Ingersoll <jared at cswv dot com>
- Cc: cygwin at cygwin dot com
- Date: Wed, 22 Oct 2003 12:44:56 -0400 (EDT)
- Subject: Re: Calling bash shell from W2K batch script
- References: <4FF77D01E13B214590F4FA3E2C3021D0419602@pecos.csw.alewife.net>
- Reply-to: cygwin at cygwin dot com
On Wed, 22 Oct 2003, Jared Ingersoll wrote:
> Hi,
>
> I was wondering if someone could provide the syntax for calling a cygwin
> shell script from the Windows 2000 cmd prompt. I'm trying to do something
> like this:
>
> d:\>start c:\cygwin\bin\bash -c "./script1.sh"
>
> But it doesn't seem to be working quite right, some pipes and such don't
> work and I can't execute a command in the script like > file.`date +%Y%m%d`.
> What I'm trying to do is write a cygwin script to execute some mixed NT
> commands and unix commands to check some network stuff, move around some
> files etc. The reason I want to do it this way is to use windows task
> scheduler to automate the task on a nightly bases.
>
> Any help would be appreciated.
> Thanks,
> Jared
Check your PATH from within bash. I suspect you don't have /bin in it.
Try 'start c:\cygwin\bin\bash -c "PATH=/bin:$PATH ./script1.sh"' or
something. You could also use "--login", but that would put you in your
home directory. I think I posted a recipe at some point for getting
around that, but changing only the path might be the simplest solution.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton
--
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/