[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Built-in printf Sits Awkwardly with UDP.
From: |
Sven Mascheck |
Subject: |
Re: Built-in printf Sits Awkwardly with UDP. |
Date: |
Mon, 18 Jul 2011 23:46:19 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Mon, Jul 18, 2011 at 10:46:19AM -0400, Steven W. Orr wrote:
> On 7/18/2011 10:14 AM, Ralph Corderoy wrote:
>> printf 'foo\nbar\n'>/dev/udp/localhost/4242
>>
>> and two packets are sent, one per line. If the aim is to send a string
>> of data in one packet this causes problems.
>>
>> Using /usr/bin/printf from coreutils gives one write(2), so that's a
>> possible workaround.
> Bash is always running in unbuffered mode, so every time a line is
> written, it automatically gets flushed. So... The only way to write in
> fully buffered mode with control over when things get flushed is to do it
> from a program that is not a bash script.
If it's just about avoiding a different printf command,
printf 'foo\nbar\n' | cat > /dev/udp/localhost/4242
(useful use of cat?) but likely not what the original poster wanted,
that is, avoiding any external command...
- Built-in printf Sits Awkwardly with UDP., Ralph Corderoy, 2011/07/18
- Re: Built-in printf Sits Awkwardly with UDP., Steven W. Orr, 2011/07/18
- Re: Built-in printf Sits Awkwardly with UDP.,
Sven Mascheck <=
- Re: Built-in printf Sits Awkwardly with UDP., Chet Ramey, 2011/07/18
- Re: Built-in printf Sits Awkwardly with UDP., Ralph Corderoy, 2011/07/18
- Re: Built-in printf Sits Awkwardly with UDP., Chet Ramey, 2011/07/19
- Re: Built-in printf Sits Awkwardly with UDP., Ralph Corderoy, 2011/07/19
- Re: Built-in printf Sits Awkwardly with UDP., Bob Proulx, 2011/07/19
- Re: Built-in printf Sits Awkwardly with UDP., Ralph Corderoy, 2011/07/20
- Re: Built-in printf Sits Awkwardly with UDP., Eric Blake, 2011/07/20
- Re: Built-in printf Sits Awkwardly with UDP., Ralph Corderoy, 2011/07/20
- Message not available
- Re: Built-in printf Sits Awkwardly with UDP., Ralph Corderoy, 2011/07/22
- Re: Built-in printf Sits Awkwardly with UDP., Chet Ramey, 2011/07/24