Thanks Brian and Peter. It works now. -sunil
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Dessent Sent: Tuesday, November 15, 2005 7:50 PM To: cygwin@cygwin.com Subject: Re: Simple cygwin script doesn't work with Windows schedular/Command prompt "Pandey, Sunil K" wrote: > However when I try to launch the same script with windows scheduler via > following command line it doesn't work. That is because if you type "/tmp/test.csh" at the prompt, bash will ask the system to execute the script and the #!/bin/csh line will be honored. It will also do this if you run it as "bash -c /tmp/test.csh", since that is by definition what the -c flag means. But if you just run "bash test.csh" (which is what you are doing in you cronjob) then bash will read the file itself and try to execute each line as if it were a command. This will also happen if you type "source test.csh" or ". test.csh". And because you are using csh syntax, not bourne shell syntax, you get unexpected results. So what this all means is that if you want /bin/csh to execute your script you need to invoke it as either "bash -c /tmp/test.csh" or "csh /tmp/test.csh". None of this has anything to do with Cygwin. You will find the exact same behavior on any *nix. Brian -- 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/ -- 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/