Looking for tool to process wildcards, passing filenames to a perl script

Hi !

In

/usr/bin/

I have a symbolic link named

epstopdf

which points to the perl script

/usr/share/texmf/scripts/epstopdf/epstopdf.pl

Now I have a larger number of .eps-files that I would like to
convert to .pdf-files using that perl script
(because it takes care of the bounding box within the .eps-files).

But a call of

epstopdf *.eps

on the command line results in nothing reasonable,
because that script isn’t designed to process wild cards.

So I have to enter each single file name manually :\

Even using copy and paste this isn’t funny when I may have to
process 200 files … :frowning:

So the question:
Is there a tool that is able to process wildcards and pass the filenames
found to the pearl script above?

Many thanks in advance!
Mike

Assuming that you use “bash” as your shell:


for file in *.eps
do
  epstopdf $file
done

On 2013-12-07 14:16, ratzi wrote:
>
> Hi !
>
> In
>
> Code:
> --------------------
> /usr/bin/
> --------------------
>
> I have a symbolic link named
>
> Code:
> --------------------
> epstopdf
> --------------------
>
> which points to the perl script

Didn’t you know that there is a dedicated forum here for scripting,
where people knowledgeable on those things can answer? Why don’t you ask
moderators to move your post there? Use the small triangle button.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Great !

Taking your code I wrote alleps.sh:

#!/bin/bash

for file in *.eps
do
  epstopdf $file
done

placed it in the same directory as the .eps-files,
and then the call

bash alleps.sh

did the whole job !

Many thanks ! :wink:
Mike

@Carlos

Hi, no, I didn’t know.

But you probably got me wrong a bit.
I didn’t have any question about that perl script (epstopdf).
I was looking for a tool that can pass filenames to that script.

Anyway, it is solved !

See you
Mike

Now, may I make a suggestion for your script:

— alleps —


#! /bin/sh -
for file in "$*"
do
  epstopdf $file
done

Put that script in your $HOME/bin directory, and mark it executable.

Then just use:


alleps *.eps

to do what you want.

You will have created a more flexible tool that does about what you originally tried – applies to everything in the argument list.

I began that with “#! /bin/sh -” because it does not use anything that is bash-specific. Any version of the Bourne shell should work.

Hmm, and now I have demonstrated why Carlos was right, that this is a scripting thread.

On 2013-12-07 15:06, ratzi wrote:

> @Carlos
>
> robin_listas;2606035 Wrote:
>> Didn’t you know that there is a dedicated forum here for scripting,
>> where people knowledgeable on those things can answer? Why don’t you ask
>> moderators to move your post there? Use the small triangle button.
>
> Hi, no, I didn’t know.

Next time :slight_smile:

> But you probably got me wrong a bit.
> I didn’t have -any- question about that perl script (epstopdf).
> I was looking for a tool that can -pass- filenames to that script.

Ah, I see.

> Anyway, it is solved !

Yep.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Seems it has become such :wink:

Thanks again !
Mike