title: can bash be executed with stdin and stdout being a tcp socket
body: <p>To give some context, I am trying to learn about pseudo-terminals (pty). A pseudo-terminal appears to a user process (bash for example) as if it was a real one. This allows to do all sorts of good stuff like telnet, ssh, etc.</p>
  
  <p>My question is, for something like telnet, is it possible to just "exec" bash and set the stdin and stdout to be the tcp connection of the remote client machine. Because if that is possible, then I don't fully understand the value of using a pseudo-terminal</p>