Re: xargs: doesn't fail on missing terminator (which may have severe consequences)

raf <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
On Thu, Dec 19, 2024 at 12:21:08PM +1100, raf <[email protected]> wrote:

> On Sat, Dec 14, 2024 at 07:55:33PM +0100, Christoph Anton Mitterer <[email protected]> wrote:
> 
> > Hey.
> > 
> > On Fri, 2024-12-13 at 23:05 +0100, Bernhard Voelker wrote:
> > > I never saw a practical example why it would be dangerous.
> > 
> > [...]
> > 
> > > Second, my main point, is that I believe that there is confusion
> > > about what -0, --null stands for.
> > > The usage output clarifies:
> > > 
> > >    -0, --null                   items are separated by a null, not
> > > whitespace;
> > >                                   disables quote and backslash
> > > processing and
> > >                                   logical EOF processing
> > > 
> > > The crucial word is "separate" which means it is something in between
> > > 2 entries:
> > >     entry1  <separator> entry2
> > > It is and was never a "terminator", i.e., something acknowledging
> > > that the previous
> > > entry is committed.
> > >    entry1 <terminator>
> 
> That might be what the "usage output" says, but it is not what find(1)
> does. It is treating NUL as a terminator in the sense that the last
> byte output with -print0 is a NUL. But that's find, not xargs.
> 
> And my copy of the GNU xargs [(GNU findutils) 4.10.0] manual entry
> says otherwise:
> 
>    -0, --null
>      Input items are terminated by a null character instead of by whitespace...
> 
> So the "usage output" disagrees with the manual entry.
> It's probably the usage output that is wrong since the
> manual entries for find and xargs agree with each other.
> 
> cheers,
> raf

Sorry, I just saw that this has already been mentioned.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.