I have a simple server listening on a Unix domain socket (on a CentOS box in case that's important). When I send the command "DATE" to the socket it writes back a welcome message and then "APRIL 15 2015". I can do this manually using the command:
socat - UNIX-CONNECT:/tmp/server.sock
but I now want to script it. I can send my DATE command to the socket by piping the output of echo to the above, but then socat returns with only the welcome message. I'm not sure if socat is returning just the first 2 lines, or waiting for a quiet period before closing the socket, or what. eg:
echo "DATE" | socat - UNIX-CONNECT:/tmp/server.sock
How can I make socat capture the whole response before disconnecting? I've tried -t and -T parameters to make it wait 5 seconds but that has no effect, socat returns immediately.