[NTLUG:Discuss] Bash Shell Script

Wilson, David David.Wilson at FTIConsulting.com
Thu Aug 14 15:32:04 CDT 2003


I am new to shell scripting and need a little assistance.  I am trying to
write a script that will copy a hard drive with dd in 640mg chunks.  I plan
on using a loop to accomplish this however I would like the condition of the
loop to terminate when dd reports an error.

For example,  script will have dd skip a variable number of blocks,  count a
number of blocks, write out to an incrementing file and then repeat.  When
dd gets to the end of the drive,  it should stop. 

Currently, I have to calculate the size of the drive in 512b blocks and then
use that value for determining when to stop copying. 

suggestions?


Thanks

David Wilson



More information about the Discuss mailing list