X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe Date: Wed, 4 Jun 2008 17:00:31 +0000 (UTC) Lines: 48 Message-ID: References: <2abc9c2d0806040808s2178885ak5dcf7cd528ea685a AT mail DOT gmail DOT com> <2abc9c2d0806040948l2f6dc1cbjd99bbdaea65cf181 AT mail DOT gmail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Blair Sutton 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/