I believe the real problem is merely that the value specified for prompt in line 5 is different than the value in line 7. If you use the same value in each case, you won't have the thorny problem of seeing a prompt both before and after the command in line 7 is sent.