Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: The "Perl script on command line works but as cronjob it fails" story revisited

by graff (Chancellor)
on Mar 06, 2013 at 04:22 UTC ( #1021942=note: print w/ replies, xml ) Need Help??


in reply to The "Perl script on command line works but as cronjob it fails" story revisited

When you say "It is impossible to test on prod," do you mean that you aren't able to use an interactive shell on prod to run the perl script on a command line (i.e. prod can only run your perl script via cron)? You didn't mention trying to run your script at the command line on the production machine.

Given the evidence provided, I would expect that there might be something like a carriage-return character at the end of the shebang line in the copy of the script that sits on prod. (Have you checked byte-counts and/or md5 checksums for the two copies of the script? Does the test copy happen to have CRLF line terminations?)

If there was that sort of difference between the test and prod copies of the script, it would explain why using /usr/bin/perl as the command executed in the shell script would get it to work via cron.


Comment on Re: The "Perl script on command line works but as cronjob it fails" story revisited
Re^2: The "Perl script on command line works but as cronjob it fails" story revisited
by karlgoethebier (Priest) on Mar 06, 2013 at 12:51 UTC

    Hi graff!

    "Does the test copy happen to have CRLF line terminations?"

    No it doesn't. If so, it won't run on Linux.

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021942]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-12-25 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (163 votes), past polls