1

I have connected to a port like this:

nc hello-world.mygame.com 2000

which opens a small game like this:

Please enter your name
a
hello a,

Now I know that a specific number of repeated "a" 's will give special output, how can I iterate over them easily (a then aa then aaa and so on) to get to that special output?

My first try:

awk 'BEGIN{for(i=1; i<=30; i++){s=s "a"; print s}}' | nc hello-world.mygame.com 2000

But it only submits a as input, how can I let it wait for others? I don't know how to use expect here?

My second try:

for x in a aa aaa; do echo $x | nc hello-world.mine.com 2000 done
John
  • 11

0 Answers0