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 c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature