On Friday 10 April 2009 08:06:17 Henri Moreau wrote:
> My script sends a UDP query to a server and gets a response datagram.  All
> packets are character strings and I have had trouble reading the response.
> A method that I have found to work is to arrange for the response packet to
> have a unique terminating character ('\0') and to pipe the response into a
> trivial gawk script with RS="\0".  Simpler methods such as using read or
> cat fail.  For read, "read -n1" will read one character but "read -nx",
> x!=1 just hangs.  Piping the response into cat reads the response but the
> pipeline does not terminate so my script cannot continue.  I would like to
> know if there are tricks and tips for using sockets more effectively in
> bash.  My search on the topic often simply advises users to keep away from
> bash networking.

showing example code people can run goes a loooong way ...
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to