in reply to Script to create huge sample files

Why not take size of input file and calculate number of repetitions = $target_size/$input_size + 1

The size requirement of 3MB + is not all that large, so default output buffering should be good enough.

-- Roman