in reply to Block device status and script termination

It is not clear that the script will atuomatically die upon the block device filling. The print statement will probably fail, however. So I would try something like this (untested):
#!/usr/bin/perl -w die "Usage: hexperlscript <blocksize> <destination file>\n" unless @AR +GV == 2; my ($input, $output) = @ARGV; die "Blocksize must be divisible by 512.\nExiting.\n" unless $input % +512== 0; $input /= 2; open ( DEST, '>>', $output ) or die "Cannot create ouput file. $! \n"; while (1) { for (0..0xff) { my $n = sprintf "%02x", $_; print DEST $n x $input or die "Could not print: $!\n"; } }

-Mark