how to write this simple script command?



Hi,

I want to write a script doing 3 shell commands in one time. I keep forgetting on how to take the argument. Could you help me?

What I really want to do is:

1)print a file into a postscirpt file using a2ps:

a2ps --output=temp.ps the_file_name //this will generate temp.ps file

2)convert temp.ps to pdf file

ps2pdf temp.ps //this will generate temp.ps.pdf file

3)remove temp.ps

rm temp.ps


I hope to have one command to do all the three things. This command takes one argument, which is the file name. It would be even better if the argument is foo.txt and the final product is foo.txt.pdf, if the argument is bar.txt and the final product is bar.txt.pdf.

Thank you for your help.
.



Relevant Pages