When you want to do something a certain number of times, but are not sure how many, consider the while loop

In this case you want to ...print "That command is not recognized" and reprint the part...