Web lists-archives.com

Re: Weird shell script behavior in a cron job




On Thu, Aug 31, 2017 at 06:52:28AM +0100, Jonathan de Boyne Pollard wrote:
> James H. H. Lampert:
> 
> > Could it be that |cron| is running it an entirely different shell, that
> > doesn't understand the |if| statement?
> > 
> Despite what others have said, the answer to this question is no.  Whilst
> you /are/ running two different shells, the problem is not the |if|
> statement.

The if statement that he actually *showed* was POSIX-compatible, yes.
But he later said that changing the shebang fixed his problem, so
there was some other part of his script that was bash-specific.