[GTALUG] bash seq question

Russell Reiter rreiter91 at gmail.com
Mon Feb 6 13:36:28 EST 2017


I had to resort to analogue to get the docs out. You remember, print the
numbers on the pages, then run them through for the data.

Curse u
seq: invalid floating point argument:  1

This one liner was my magic bullet a few short kernel updates ago. Tunnel
in get the job done right and exit. Kind of like Robert De Nero in Brazil
but without the yankee screwdriver and abseiling gear.

Williams suggestions also threw seq: invalid args.

Thanks both.
Russell

On Feb 2, 2017 7:22 PM, "Stewart C. Russell via talk" <talk at gtalug.org>
wrote:

> Hi Russell -
>
> > It's not often I have to assemble larger numbered documents. I usually
> > use this little script.
> >
> > enscript -L1 -F --header-font=Times-Roman12 -b '||$%' -o- < <(for i in
> > $(seq "$(pdftk "$1" dump_data | grep "Num" | cut -d":" -f2)"); do echo;
> > done) | ps2pdf - | pdftk "$1" multistamp - output
> "${1%.pdf}-numbered.pdf"
>
> I've used something similar myself many times. Your grep command should be:
>
>         grep '^PageMediaNumber:'
>
> as you're also matching 'PageLabelNumStyle' content. These aren't
> numeric values, and will cause seq to fail. It may also be possible for
> PageMediaNumber to return something like '1-1'.
>
> Personally, I'd use pdfinfo rather than pdftk … dump_data to do page
> counts, as its Pages field is always numeric.
>
> Bates Numbering is fun!
>
> cheers,
>  Stewart
>
>
> ---
> Talk Mailing List
> talk at gtalug.org
> https://gtalug.org/mailman/listinfo/talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/talk/attachments/20170206/f2efa7da/attachment.html>


More information about the talk mailing list