Wait -Statement in Unix ShellScripts

Wait -Statement in Unix ShellScripts

Post by Thomas Kinderman » Wed, 12 Jan 2000 04:00:00



I wrote a shell-script for a unix-maschine (Unix IBM AIX 4.3.2) and i used
the wait command.

When i start the script from the command-prompt everything works all right.
but if i start it with the cron -job the following problems appear:
    1) the sub-shells were not started
    2) the wait command was ignored because 1) (i think so ;-))

Please can anybody help me a.s.a.p.?????????
(our data-secure does not work)

Thanks

Thomas Kindermann

 
 
 

Wait -Statement in Unix ShellScripts

Post by Patrice Alla » Wed, 12 Jan 2000 04:00:00


On Tue, 11 Jan 2000 10:33:06 +0100, "Thomas Kindermann"


>I wrote a shell-script for a unix-maschine (Unix IBM AIX 4.3.2) and i used
>the wait command.

>When i start the script from the command-prompt everything works all right.
>but if i start it with the cron -job the following problems appear:
>    1) the sub-shells were not started
>    2) the wait command was ignored because 1) (i think so ;-))

>Please can anybody help me a.s.a.p.?????????
>(our data-secure does not work)

Maybe you have some kind of pre-requisite for a terminal in your
sub-shell actions : just try to re-direct both stdout & stderr in your
cron command. If this is not enough, try to redirect stdin too (but is
needed only in some wierd cases).

Hope this helps,
Patrice.

 
 
 

Wait -Statement in Unix ShellScripts

Post by Matthew Land » Wed, 12 Jan 2000 04:00:00



> I wrote a shell-script for a unix-maschine (Unix IBM AIX 4.3.2) and i used
> the wait command.

> When i start the script from the command-prompt everything works all right.
> but if i start it with the cron -job the following problems appear:
>     1) the sub-shells were not started
>     2) the wait command was ignored because 1) (i think so ;-))

> Please can anybody help me a.s.a.p.?????????
> (our data-secure does not work)

> Thanks

> Thomas Kindermann

Are you properly defining FULL path for all executables in the script?  
It is possible the script works on command line because your shell has
the PATH variable defined where crontab doesn't.  Another LESS gracefull
dirty workaround is to add the sourcing of your login file or add the
PATH declaration to the top of the script.

 - Matt

--

  AIX and HACMP Certified Specialist   | |  / \ |\| |  \. ,_|  ` o O '
  / Comments, views, and opinions \    | |_/ ^ \|   | ) | |       x    
  \ are mine alone, not IBM's.    /    |___|/~\_\_|\|__/|_|     \___/