how to convert all ps file to pdf?

Status
Not open for further replies.

surreyian

Member level 3
Joined
Feb 10, 2006
Messages
63
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,796
hello,

while converting ps file to pdf i use ps2pdf <filename>.ps and convert file by file.
now i have generate over 100 .ps files. I know if i want to remove all ps files, I can use rm *.ps
Is there any ways (if available) that i can convert all the .ps files to .pdf files?
I tried ps2pdf *.ps but it doesnt work.

thanks in advance.
 

using sh
%sh
for in *.ps do
ps2pdf $i
done
rm -f *.ps
exit
%

or more elegant using find
%find . -name *.ps -exec ps2pdf '{}' \;
 

Another way use Cshell command :

########################
#! /bin/csh -f

foreach cell (`cat lists`)
ps2pdf $cell
end
########################


File "lists" is the list of all ps files which can be created by unix command "ls *.ps >lists".
 

Yet another way:
ls *.ps | xargs -n1 ps2pdf
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…