I'm generating a binary file as test data for a piece of software. The test data should consist of a long array of the same byte. If it was a zero byte I would use /dev/zero. Is there a command to transform the zeros from there into another byte, or a command to do a similar thing?
I came up with this bash script, but this solution doesn't feel ideal. It can only generate a fixed number of bytes. There is surely a way to do this with a simpler script.
for i in $(seq 5); do
echo $'\x10'
done