[Gloucs] bash question
Glyn Davies
glynd at walmore.com
Tue Nov 30 20:43:54 UTC 2010
'lo
Any suggestions on how to do the following?
I have a directory full of pdfs and I want to concatenate them into
one large pdf.
ghostscript can do this but the command is basically:
gs -o outputfile.pdf infile1.pdf infile2.pdf
So a script is in order (there's more pdfs than I'd like to do by hand)
Every time I try to tackle something like this I end up with a counter
(say n) and end up with the following problem:
if n is 1, $n returns 1. I want to use n to cycle through the command
line arguments so I end up with $$n the idea being $1 is the first
command line argument so $n would return 1, leaving $1 which return
the 1st command line argument.
Now, I know this is wrong and won't work but no matter what (), {}, %
and ` I put I can make it do what I want. How do you do it (assuming
you can).
So two problems there but the first reintroduced me to the latter.
--
Best Regards
Glyn Davies
More information about the gloucs
mailing list