If it's zeros to a file, then the obvious one is:
dd if=/dev/zero of=file.bin bs=1 count=128
Note that this is pretty inefficient as it goes, as it does single byte writes. You could just as easily use:
dd if=/dev/zero of=file.bin bs=128 count=1
Here, bs' is the 'block size' andcount` is how many blocks. Better to write one block than lots of little ones!
Note that the above commands do not append to file.bin, they overwrite it. One way round that is:
dd if=/dev/zero bs=128 count=1 >> file.bin
Explanation: in the absence of of=, dd writes to standard output, which is then appended to the output file.
echoshould process-eand-n, but just in case you're running that script withsh myscript.sh, take into account thatshmight be a different shell. – ilkkachu Jul 10 '17 at 11:26