X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <2abc9c2d0806061557g36381d64g7e0406c2021c6e1d@mail.gmail.com>
Date: Fri, 6 Jun 2008 23:57:12 +0100
From: "Blair Sutton" <blairuk@googlemail.com>
To: "Pierre A. Humblet" <Pierre.Humblet@ieee.org>
Subject: Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
Cc: cygwin@cygwin.com
In-Reply-To: <00da01c8c7f1$1982d6f0$d50410ac@wirelessworld.airvananet.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <2abc9c2d0806040808s2178885ak5dcf7cd528ea685a@mail.gmail.com> 	 <2abc9c2d0806040948l2f6dc1cbjd99bbdaea65cf181@mail.gmail.com> 	 <006701c8c756$1b923260$d50410ac@wirelessworld.airvananet.com> 	 <2abc9c2d0806051528w6aa5c8f5g6bf946291171d579@mail.gmail.com> 	 <2abc9c2d0806060116t2da2970as52d545f7a38560b7@mail.gmail.com> 	 <00da01c8c7f1$1982d6f0$d50410ac@wirelessworld.airvananet.com>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Thanks again for your offer of help. However, I can say now that
neither of your powershell solutions work (the inline one or the exec
wrapper script).

I'm not sure why you are so resistant to adding a simple but useful
patch; perhaps it would have been easier to add the patch than waste
everyone's time with these half-baked workarounds.

Still, I am sure you mean well. Please don't bother responding. Best wishes....

On Fri, Jun 6, 2008 at 5:19 PM, Pierre A. Humblet
<Pierre.Humblet@ieee.org> wrote:
>
> ----- Original Message -----
> From: "Blair Sutton" <>
> To: <cygwin>
> Sent: Friday, June 06, 2008 4:16 AM
> Subject: Re: Patch to allow Cron to use non-POSIX shells like Powershell.exe and CMD.exe
>
>
> | On further investigation, it appears powershell does alias "-c" for
> | "-command" hence no changes would be required for cron to support it.
> | However, the change would still be useful for other shells or perhaps
> | interpreters like Perl.
> |
> | On Pierre's offered solution: I now do recall how exec works and it is
> | correct that it replaces the current process - although a there will
> | be some overhead. However, that begs the question why cron ever
> | supported the SHELL parameter in the first place; if Mr Vixie wanted
> | everyone to write a wrapper script using his preferred shell.
>
> Here is an even simpler solution: specify the shell you want in the crontab itself
> Like
> * * * * *  cmd /c "some DOS stuff"
> * * * * *  powershell -command "some powershell stuff"
> * * * * *  bash -c "some bash stuff"
>
> No need to specify SHELL, no wrapper shell, mix and match interpreters, maximal flexibility.
> And the top shell (sh) is smart and will exec the subshell because it recognizes
> that's the only thing it has to do.
> To verify that, try
> strace sh -c "cmd /C sh -c \"/bin/echo hello\"" | grep -i 'spawn\|fork'
>
> Pierre
>
>

--
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/

