I need help with the redirection of the output from dd in a logfile.
Following you will see two scripts, but both scripts creates only empty files without the contents...
The scripts reads from /dev/urandom and writes then to the disks (seven times)
1. script with normal redirection:
------------------------------------------------------
#!/bin/bash
for i in {1..7}
do
dd if=/dev/urandom of=/dev/dsk/c0d0s0 bs=1048576 conv=notrunc >> run$i-dsk0.log &
dd if=/dev/urandom of=/dev/dsk/c0d1s0 bs=1048576 conv=notrunc >> run$i-dsk1.log &
wait
done
-------------------------------------------------------
2. script with tee:
-------------------------------------------------------
#!/bin/bash
for i in {1..7}
do
dd if=/dev/urandom of=/dev/dsk/c0d0s0 bs=1048576 conv=notrunc | tee run$i-dsk0.log &
dd if=/dev/urandom of=/dev/dsk/c0d1s0 bs=1048576 conv=notrunc | tee run$i-dsk1.log &
wait
done
--------------------------------------------------------
Have you any ideas?
Thank you!