27 May 2004
Show progress of dd
Here is a perl code example which shows progress of dd made by my friend Thor Dreier:
sdd if=/boot.img.gz of=/dev/sda -pg bs=1M 2>&1 | perl -e 'print $i++." MB\n" while(read(STDIN,$c,3));'
Here is a perl code example which shows progress of dd made by my friend Thor Dreier:
sdd if=/boot.img.gz of=/dev/sda -pg bs=1M 2>&1 | perl -e 'print $i++." MB\n" while(read(STDIN,$c,3));'
Doesn’t work. Is there a typo?
bash: syntax error near unexpected token `&’
Hang on – this is sdd, not dd.
However I still can’t see what 2> is supposed to be doing from man sdd
Can someone explain this?
@wdef
After migrating my blog from Serenditpity to WordPress it messed with some of my examples… I’ve corrected the code now. Please try again
it causes redirect stderr to the same file handle as stdout.
May 13, 2009