[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: printf -u "$fd"?
From: |
Chet Ramey |
Subject: |
Re: printf -u "$fd"? |
Date: |
Mon, 20 May 2024 15:03:23 -0400 |
User-agent: |
Mozilla Thunderbird |
On 5/17/24 10:53 PM, Zachary Santer wrote:
So here's another tangent, but has it been considered to add an option
to the printf builtin to print to a given file descriptor, rather than
stdout? If printing to a number of different file descriptors in
succession, such an option would appear to have all the same benefits
as read's -u option.
It doesn't actually save anything; it's just syntactic sugar. Since
`printf' uses stdio internally (as opposed to `read', which uses the
supplied file descriptor directly), you're still going to have to dup2
it internally somewhere. dprintf could do some of the work here, and bash
has a replacement for systems where it's missing, but that's more than I
want to change before bash-5.3 comes out. Maybe after that.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature
- printf -u "$fd"?, Zachary Santer, 2024/05/17
- Re: printf -u "$fd"?, Kerin Millar, 2024/05/19
- Re: printf -u "$fd"?, alex xmb sw ratchev, 2024/05/19
- Re: printf -u "$fd"?,
Chet Ramey <=
- Re: printf -u "$fd"?, Zachary Santer, 2024/05/21
- Re: printf -u "$fd"?, Chet Ramey, 2024/05/21
- Re: printf -u "$fd"?, Zachary Santer, 2024/05/21
- Re: printf -u "$fd"?, Chet Ramey, 2024/05/21
- Re: printf -u "$fd"?, Zachary Santer, 2024/05/22
- Re: printf -u "$fd"?, Zachary Santer, 2024/05/22
- Re: printf -u "$fd"?, Chet Ramey, 2024/05/22
- Re: printf -u "$fd"?, Koichi Murase, 2024/05/22