>>478
fgets(...);
fgets(...);
としてユーザの入力を得るなら、
y
y
n
と記述したテキストを用意して、

executable < commands.txt

これで出来る