printf %n is not documented

2022-12-23 Thread Emanuele Torre
About two months ago, I discovered, reading the bash source code for printf, the %n format specifier. What it does is assign to the variable specified as its argument, the number of bytes that have been written so far (similarly to the C counterpart). This can be quite useful if you, for example,

Re: printf %n is not documented

2022-12-23 Thread Chet Ramey
On 12/23/22 7:24 AM, Emanuele Torre wrote: About two months ago, I discovered, reading the bash source code for printf, the %n format specifier. What it does is assign to the variable specified as its argument, the number of bytes that have been written so far (similarly to the C counterpart).

Re: printf %n is not documented

2022-12-23 Thread Greg Wooledge
On Fri, Dec 23, 2022 at 06:53:08PM -0500, Chet Ramey wrote: > On 12/23/22 7:24 AM, Emanuele Torre wrote: > > About two months ago, I discovered, reading the bash source code for > > printf, the %n format specifier. > > > > What it does is assign to the variable specified as its argument, the > > n

Re: printf %n is not documented

2022-12-23 Thread Emanuele Torre
On Fri, Dec 23, 2022 at 06:53:08PM -0500, Chet Ramey wrote: > On 12/23/22 7:24 AM, Emanuele Torre wrote: > > About two months ago, I discovered, reading the bash source code for > > printf, the %n format specifier. > > > > What it does is assign to the variable specified as its argument, the > > n