in reply to Script doesn't exit when run from cron.

Hmm, can I presume that writekeyscmdline is the name of your script? , without bending my head too much, it looks like your backtick command to ps will not only discover any previously running invocations , but also the PRESENT invocation.

Check if the PID in $result is the same as $$ , ie the PID of the running script. If so - it will be sleep 60'ing because it's running. if that makes sense.


I can't believe it's not psellchecked
  • Comment on Re: Script doesn't exit when run from cron.

Replies are listed 'Best First'.
Re: Re: Script doesn't exit when run from cron.
by brewmaker (Novice) on Jan 17, 2003 at 14:28 UTC
    The second grep -v keeps grep from showing the present invocation. This part of the script works.

    What I'm trying to find out is why the exit unless(-e filename)doesn't cause the script to exit when the filename doesn't exist.

    It may be an environment/path issue. I will do some more testing today.

    Thanks for the reply

      -Mike