Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-11 Thread Harald van Dijk via austin-group-l at The Open Group
On 10/09/2021 22:54, Joerg Schilling via austin-group-l at The Open Group wrote: "Harald van Dijk via austin-group-l at The Open Group" wrote: Either the distinction matters or it doesn't. If it matters, then it was important to switch back to talk about what O?uz wrote. If it doesn't

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-11 Thread Stephane Chazelas via austin-group-l at The Open Group
2021-09-11 01:55:56 +0200, Joerg Schilling via austin-group-l at The Open Group: [...] > So the main problem I see is that the option -r is probably not usable anymore > because ksh's builtin print(1) implements -r for a different purpose. [...] 2001-10-18 15:15:34 +0100, Oliver Kiddle: [...] >

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Joerg Schilling via austin-group-l at The Open Group
"Don Cragun via austin-group-l at The Open Group" wrote: > I think you're confusing the requirements for printf and echo. The standard > echo is not allowed to accept options. The standard printf does not define > any options, but allows them as implementation extensions. Thank you!

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Don Cragun via austin-group-l at The Open Group
> On Sep 10, 2021, at 3:29 PM, Joerg Schilling via austin-group-l at The Open > Group wrote: > > "Stephane Chazelas via austin-group-l at The Open Group" > wrote: > >> 2021-09-10 22:46:26 +0100, Stephane Chazelas via austin-group-l at The Open >> Group: >> [...] >>> I've personally used the

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Stephane Chazelas via austin-group-l at The Open Group
2021-09-11 00:29:44 +0200, Joerg Schilling via austin-group-l at The Open Group: [...] > > As mentioned on that mailing list and it's still undocumented, > > -r can be used with print -f to disable reuse: > > The problem, POSIX defines printf(1) to not handle options. So I don't think, > we

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Joerg Schilling via austin-group-l at The Open Group
"Stephane Chazelas via austin-group-l at The Open Group" wrote: > 2021-09-10 22:46:26 +0100, Stephane Chazelas via austin-group-l at The Open > Group: > [...] > > I've personally used the feature to reorder items in sets, so > > would object to precluding reusing arguments. > [...] I agree...

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Stephane Chazelas via austin-group-l at The Open Group
2021-09-11 00:04:20 +0200, Joerg Schilling via austin-group-l at The Open Group: > "Stephane Chazelas via austin-group-l at The Open Group" > wrote: > > > For the record, see the interesting discussions on the zsh > > mailing list from when that feature was added there almost > > exactly 20

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Stephane Chazelas via austin-group-l at The Open Group
2021-09-10 22:46:26 +0100, Stephane Chazelas via austin-group-l at The Open Group: [...] > I've personally used the feature to reorder items in sets, so > would object to precluding reusing arguments. [...] As mentioned on that mailing list and it's still undocumented, -r can be used with print

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Joerg Schilling via austin-group-l at The Open Group
"Stephane Chazelas via austin-group-l at The Open Group" wrote: > For the record, see the interesting discussions on the zsh > mailing list from when that feature was added there almost > exactly 20 years ago: > > https://www.zsh.org/mla/workers/2001/msg02715.html >From the information I

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Joerg Schilling via austin-group-l at The Open Group
"Harald van Dijk via austin-group-l at The Open Group" wrote: > Either the distinction matters or it doesn't. If it matters, then it was > important to switch back to talk about what O?uz wrote. If it doesn't > matter, then it should not be a problem that I switched back to talk > about what

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Stephane Chazelas via austin-group-l at The Open Group
For the record, see the interesting discussions on the zsh mailing list from when that feature was added there almost exactly 20 years ago: https://www.zsh.org/mla/workers/2001/msg02715.html https://www.zsh.org/mla/workers/2001/msg02716.html https://www.zsh.org/mla/workers/2001/msg02740.html

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Harald van Dijk via austin-group-l at The Open Group
On 10/09/2021 22:14, (Joerg Schilling) wrote: Harald van Dijk wrote: Not correct: ksh93 prints the same as bosh Indeed, something went wrong with the copying there. > and pleasew note that my example is > using an integer format instead of a string format. Irrelevant. You wrote: >

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Joerg Schilling via austin-group-l at The Open Group
Harald van Dijk wrote: > > Not correct: ksh93 prints the same as bosh > > Indeed, something went wrong with the copying there. > > > and pleasew note that my example is > > using an integer format instead of a string format. > > Irrelevant. You wrote: > > > That is exactly what existing

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Harald van Dijk via austin-group-l at The Open Group
On 10/09/2021 21:34, (Joerg Schilling) wrote: Harald van Dijk wrote: No, it isn't. The second command prints ksh93: c a d zsh: printf: 3: argument specifier out of range c a bosh: c a d Not correct: ksh93 prints the same as bosh Indeed, something went wrong

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Joerg Schilling via austin-group-l at The Open Group
"Robert Elz via austin-group-l at The Open Group" wrote: > Date:Fri, 10 Sep 2021 21:43:32 +0300 > From:=?UTF-8?B?T8SfdXo=?= > Message-ID: > > > | Wouldn't it be more useful if, in printf(1), `n' in `%n$' referred to the > | nth argument in the current set of

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Joerg Schilling via austin-group-l at The Open Group
Harald van Dijk wrote: > No, it isn't. The second command prints > > ksh93: > >c a >d > > zsh: > >printf: 3: argument specifier out of range >c a > > bosh: > >c a > d Not correct: ksh93 prints the same as bosh and pleasew note that my example is using an integer

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Harald van Dijk via austin-group-l at The Open Group
On 10/09/2021 20:27, Joerg Schilling via austin-group-l at The Open Group wrote: "O?uz via austin-group-l at The Open Group" wrote: Wouldn't it be more useful if, in printf(1), `n' in `%n$' referred to the nth argument in the current set of arguments being processed? For example, the

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Oğuz via austin-group-l at The Open Group
10 Eylül 2021 Cuma tarihinde Robert Elz yazdı: > > But the third argument is c the first time around. > Why would that be replaced by '' ? > It is then, perhaps, '' the next iteration of the format string. > I should have said "the current subset of arguments being processed" or something like

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Robert Elz via austin-group-l at The Open Group
Date:Fri, 10 Sep 2021 21:43:32 +0300 From:=?UTF-8?B?T8SfdXo=?= Message-ID: | Wouldn't it be more useful if, in printf(1), `n' in `%n$' referred to the | nth argument in the current set of arguments being processed? That's what it does in current

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Joerg Schilling via austin-group-l at The Open Group
"O?uz via austin-group-l at The Open Group" wrote: > Wouldn't it be more useful if, in printf(1), `n' in `%n$' referred to the > nth argument in the current set of arguments being processed? For example, > the command: > > printf '%2$s %1$s\n' a b c d > > would print: > > b a > d

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Oğuz via austin-group-l at The Open Group
10 Eylül 2021 Cuma tarihinde Robert Elz via austin-group-l at The Open Group yazdı: > > When %n$ was added to those implementations of printf which support it, > it seems to have been added in the simplest way possible - printf simply > picks the identified arg, instead of the "next" one, and the

Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Robert Elz via austin-group-l at The Open Group
I gather that it is likely that the work on gettext is going to want to add support for the "pick an argument" printf conversion type (%n$) of conversions that are defined currently in XSH for the printf family of interfaces, but isn't defined in XCU printf. That's probably a good idea, but I