On second glance i found a bug in your code:
But the shell-prompt "user@host:~$" doesn't have one
=> endless blocking of Readline() and your loop would never exit.
if (shells.CanRead)
output = shells.ReadLine();
match = regex.Match(output);
match.Success will never become true. ReadLine() blocks till a newline appears.But the shell-prompt "user@host:~$" doesn't have one
=> endless blocking of Readline() and your loop would never exit.