Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
- Date: Wed, 4 Jun 2008 17:48:11 +0100
- From: "Blair Sutton" <blairuk@xxxxxxxxxxxxxx>
- Subject: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
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.
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.
Typical usage is
#SHELL=/cygdrive/c/WINDOWS/system32/CMD.exe
#SHELLSWITCH=/c
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
* * * * * & 'C:\Documents and Settings\blair sutton\My
Documents\WindowsPowerShell\Test\test.ps1' one two three
* * * * * & 'C:\Documents and Settings\blair sutton\My
Documents\WindowsPowerShell\Test\test.ps1' one two three | out-null
* * * * * & "${env:userprofile}\My``
Documents\WindowsPowerShell\Test\test.ps1" one two three
* * * * * "~\my` documents\test.ps1" one two three
Hope you might be able to use it.
Kind regards
Blair
Attachment:
cron-bs.patch
Description: Binary data
Attachment:
cron.tab
Description: Binary data
-- 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/
- Follow-Ups:
- Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
- From: Pierre A. Humblet
- Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
- From: Eric Blake
- Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
- Prev by Date: Re: Can I use -display option with ported application ??
- Next by Date: Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
- Previous by thread: Can I use -display option with ported application ??
- Next by thread: Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
- Index(es):