title: Bash script to connect to open port, send request, read response
body: <p>I have a service running on localhost:port. In a bash script I want to connect to this port, send a request, and read back the response - essentially automating a telnet session. What's the best way of doing this? Am looking at /dev/tcp, netcat or telnet/expect.</p>
  
  <p>Thanks</p>