Saturday, May 5, 2012

ssh breaks the while loop ssh breaks the while loop

I created a script that will execute command on the remote server using a ssh. Basically, you will command ssh user@server "command". However, ssh keeps on breaking the loop and it only takes action on the first line of the output. I discovered that it needs to stop reading from stdin. So I put -n on my ssh command and while loop is now ok.
ssh -n user@server "command"

No comments:

Post a Comment