in reply to Running a Background Job

"my top command does not execute" is a rather vague problem description. Could you be more specific?

If you're referring to the fact that nothing gets written to top.log, then you're mistaken when you said it runs fine without the "&". You never write anything to that file.

Replies are listed 'Best First'.
Re^2: Running a Background Job
by Anonymous Monk on Nov 20, 2007 at 23:45 UTC
    Correction:
    use strict; open (OUT,">top.log") or die "cannot create: $!\n"; for (;;){ my $top = `top n 1`; print OUT $top; sleep 10; } close OUT;
    Sorry I was actually abbreviating my original script from memory. The script writes and executes top just fine when I don't run it as a background job. The explanation that top does not run as a background job is very helpful. Thank you.