This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
- From: Eric Blake <ebb9 at byu dot net>
- To: cygwin at cygwin dot com
- Date: Wed, 4 Jun 2008 17:00:31 +0000 (UTC)
- Subject: Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
- References: <2abc9c2d0806040808s2178885ak5dcf7cd528ea685a@mail.gmail.com> <2abc9c2d0806040948l2f6dc1cbjd99bbdaea65cf181@mail.gmail.com>
Blair Sutton <blairuk <at> googlemail.com> writes:
>
> I simply introduce a new environment variable called SHELLSWICTH that
> defaults to "-c" if not used. Otherwise, one can set it to "/c" or
> "-Command" for Windows shells.
Why should we patch a cygwin utility to promote the use of a non-cygwin shell?
> Attachment (cron-bs.patch): application/octet-stream, 718 bytes
> Attachment (cron.tab): application/octet-stream, 709 bytes
Sending text files as application/octet-stream makes them harder to read in
email. Consider using a text MIME type instead.
>
> Hi
>
> This is a very simple patch for Cron to allow one to use a shell like
> powershell or cmd. I've done some testing and it appears to work well.
You should fix your mailer to not send duplicate copies of a message when
writing to a text-only mailing list.
>
> SHELL=/cygdrive/c/WINDOWS/system32/windowspowershell/v1.0/powershell.exe
> SHELLSWITCH=-Command
>
> * * * * * echo test 1 2 3
> * * * * * ls c:
> * * * * * & 'C:\Documents and Settings\blair sutton\My
> Documents\WindowsPowerShell\Test\test.ps1' one two three
And what's wrong with doing this with what cron already provides:
* * * * * /cygdrive/c/windows/system32/windowspowershell/v1.0/powershell -
Command '"c:\documents and settings\blair sutton\my
documents\windowspowershell\test\test.ps1" one two three'
>
> Hope you might be able to use it.
I'm not the cron maintainer, but I hope he doesn't bloat the code for this.
--
Eric Blake
--
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/