Converting ps file to pdf

I have a number of post script files (*.ps) which I need to convert into Pdf.

I am using the ps2pdf command for this, but the trouble is that this commands takes only one input at a time. So the command

ps2pdf *.ps doesnt work.

how can I make a script which will take each .ps file from current directory and feed it to ps2pdf command??

Here's the simplest way to do so:

#!/bin/sh
for psfile in `ls -1 *ps`
do
ps2pdf $psfile
done

Hi,

Yogesh has given proper info but just you have to be specific
i mean , while giving file name or file extension..

use "*.ps" instead of "*ps"

#!/bin/sh
for psfile in `ls -1 *ps`
do
ps2pdf $psfile
done

Thanks a lot ... its working