Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #244969
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Printing lots of pages skips a few |
| Date | 2022-02-02 18:10 +0100 |
| Message-ID | <DMriP-j7-15@gated-at.bofh.it> (permalink) |
| References | <DLXNL-7lF-1@gated-at.bofh.it> <DM0sh-Di-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue 01 Feb 2022 at 07:29:09 (-0500), Greg Wooledge wrote:
> On Tue, Feb 01, 2022 at 03:04:06PM +0530, Pankaj Jangid wrote:
> > I tried to print ~40 pages using the following combination of commands:
> >
> > find . -name "pref***.pdf" | xargs lp
> >
> > The result was that a couple of pages were missed.
>
> That command is fundamentally broken. It will fail if any of the
> matching filenames contain whitespace, single quotes or double quotes.
>
> A correct version would be:
>
> find . -name "pref*.pdf" -exec lp {} +
>
> That's the preferred one. If you're really old-fashioned and just cannot
> live without xargs, the first thing you must realize is that POSIX xargs
> is fundamentally incapable of doing this correctly. GNU xargs has a -0
> extension, though, which makes it possible:
>
> find . -name "pref*.pdf" -print0 | xargs -0 lp
>
> That one is acceptable, albeit longer, less efficient and less portable.
(… goes off to check .bashrc, and comes back …)
I find frequent use of xargs, and they're almost all on account of
needing … -print0 | LC_ALL=C sort -z | xargs -0 … (± the locale).
And in the OP's case, this might save a little effort, because my
next step in the investigation would be to check the files in
/var/spool/cups/c* to make sure that all the files had actually
been queued. If so, what does each file report as happening.
(The files are timestamped, so their later repeat printings can
be discounted.)
The OP might want to sort on date and/or sequence number if they
were going to bother to sort at all. The sort options are
complicated a little by the choice of ddmmyy, rather than yymmdd,
for the date field.
Cheers,
David.
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Printing lots of pages skips a few Pankaj Jangid <pankaj@codeisgreat.org> - 2022-02-01 10:40 +0100
Re: Printing lots of pages skips a few Greg Wooledge <greg@wooledge.org> - 2022-02-01 13:30 +0100
Re: Printing lots of pages skips a few Pankaj Jangid <pankaj@codeisgreat.org> - 2022-02-01 18:20 +0100
Re: Printing lots of pages skips a few Greg Wooledge <greg@wooledge.org> - 2022-02-01 19:10 +0100
Re: Printing lots of pages skips a few Pankaj Jangid <pankaj@codeisgreat.org> - 2022-02-02 11:50 +0100
Re: Printing lots of pages skips a few Klaus Singvogel <deb-user-ml@singvogel.net> - 2022-02-01 21:40 +0100
Re: Printing lots of pages skips a few Pankaj Jangid <pankaj@codeisgreat.org> - 2022-02-02 11:50 +0100
Re: Printing lots of pages skips a few Curt <curty@free.fr> - 2022-02-02 15:00 +0100
Re: Printing lots of pages skips a few Pankaj Jangid <pankaj@codeisgreat.org> - 2022-02-03 05:50 +0100
Re: Printing lots of pages skips a few David Wright <deblis@lionunicorn.co.uk> - 2022-02-02 18:10 +0100
Re: Printing lots of pages skips a few Pankaj Jangid <pankaj@codeisgreat.org> - 2022-02-03 05:50 +0100
csiph-web