[Gloucs] bash question

Glyn Davies glynd at walmore.com
Tue Nov 30 21:21:44 UTC 2010


Hmmm. Yes, how embarassing, I do believe gs will take multiple input files so

gs -o out.pdf *.pdf should do it.

Will try it.

And thanks Keith for the double indirection advice. Will try that too.
Must write that down some where where I will never forget or lose it.


On 30 November 2010 21:12, Matthew Phillips <phillips321 at gmail.com> wrote:
> If you can put all the files on one line why not just
>
> gs -o out.PDF 'ls *.pdf'
>
> The ' are the ticks to the left of the number one on the keyboard, I
> can't type them on the iPhone!
>
> Case sensitive unix is your friend.
>
> Matthew Phillips
> M: 07818 233332
> E: phillips321 at gmail.com
> Sent from iPhone
>
> On 30 Nov 2010, at 21:06, Iain Calder <iain.calder at gmail.com> wrote:
>
>> How about using xargs for the first requirement, e.g.:
>>
>> find *.pdf | xargs gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -q
>> -sOutputFile=outputfile.pdf
>>
>>
>> On 30 November 2010 20:43, Glyn Davies <glynd at walmore.com> wrote:
>>
>>> '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
>>>
>>> _______________________________________________
>>> gloucs mailing list
>>> gloucs at mailman.lug.org.uk
>>> https://mailman.lug.org.uk/mailman/listinfo/gloucs
>>>
>> _______________________________________________
>> gloucs mailing list
>> gloucs at mailman.lug.org.uk
>> https://mailman.lug.org.uk/mailman/listinfo/gloucs
>
> _______________________________________________
> gloucs mailing list
> gloucs at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/gloucs
>



-- 
Best Regards
Glyn Davies



More information about the gloucs mailing list