I was just doing something like (in ksh) :
( dd if=/dev/rmt0.1 count=10; status=$? ) | tar -tvf - | head -8
in a script, and was trying to figure out why $status never
changed ( and thus why it never left the loop. ).
Once I actually read what I was writing ( :-> ) I figured out
I guess I have to do something like:
( dd if=/dev/rmt0.1 ; echo $? 1>.dd.status ) | tar -tvf - | head -8
read status <.dd.status
Which seems to work.
But is there a less convoluted way to get the status from
the first command in the pipeline?
- Univ. of *ia - Department of Molecular Physiology and Biological Physics