I have a C program and I need to test program reads stdin when called like this
./program
Now I have to write a bash script that will send it an increassingly long string! For example first a, then aa, aaa, aaaa and so on. How can I do this?
I already found a nice way to construct a string (I iterate over string_length):
string=(head -c string_length < /dev/zero | tr '\0' '\141')
but how do I pass it to my program using stdin?