I need to run a simple C program several time, each one with different input string (let's say AAAAA... increasing size, until I get "TRUE" as output). e.g.
./program A # output FALSE
./program AA # output FALSE
./program AAA # output FALSE
./program AAAA # output FALSE
./program AAAAA # output FALSE
./program AAAAAA # output FALSE
./program AAAAAAA # output TRUE
in C I would simply use a while loop. I know in python there is the while loop as well.
So the python program would be:
strlen = 0
while TRUE
strlen++
<run ./**C program** "A"*strlen >
if (<program_output> = TRUE)
break
Given that I can make the .py script executable by writing
#! /usr/bin/env python
and
chmod +x file.py
What should I do to make this work?
Thanks in advance