On Tue, Aug 27, 2002 at 03:04:35PM -0400, Greg Freemyer wrote:
> I have the very basics of a new test almost working. I'm assuming it will be
Good stuff. 068 sounds fine.
> One big problem I have is that I start a background infinite loop of dd's to
> generate some i/o load.
> while true; do
> dd if=/scratch/dummy of=/scratch/junk bs=64k >/dev/null 2>&1
> rm /scratch/junk
> done >/dev/null 2>&1 &
> At the end of the script I kill this off. Unfortunately, when it dies the
> parent shell is notifying the user with output like:
> > 068: line 127: 3956 Killed while true; do
> > dd if=/scratch/dummy of=/scratch/junk bs=64k >/dev/null 2>&1; rm
> > /scratch/junk; sync;
> > done >/dev/null 2>&1
> in my 068.out file. Since this has pids in the output, I always get a
> failure message.
> Is there a way to say that output should not be compared, or do you know some
> shell trick to avoid having this output generated.
The trick is knowing where the output is coming from and selectively
filtering it so that you only have error/other messages which are of
relevence to the test being sent to the output file.
In your case, it looks like the parent shell of your while loop (this
is almost certainly this is the shell process running your script) is
the source of your "Killed" message. So, one approach here would be
to do something like wrapping the loop in a sub-shell (using parens)
and sending that shell's output into oblivion, ala...
( while true; do
... foo ...
done ) >/dev/null 2>&1 &
You may also want to recheck your shell loop above, it doesn't look
quite like what I thought it was trying to do when I first read it -
are you missing a count=XXX argument from your dd? If not, the rm and
sync will (by my reading of it, anyway) never get executed... and not
much point in making it a loop? Perhaps I've misunderstood the intent