Re: how to write this simple script command?
- From: Lew Pitcher <lpitcher@xxxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 06:51:11 -0800 (PST)
On Jan 31, 9:29 am, www <w...@xxxxxxxxxx> wrote:
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.
begin sample script a2pdf
#!/bin/bash
# Usage: a2pdf path-to-text-file
rm -f temp.ps
a2ps --output=temp.ps $1
ps2pdf temp.ps
rm -f temp.ps
end sample script a2pdf
.
- Follow-Ups:
- References:
- how to write this simple script command?
- From: www
- how to write this simple script command?
- Prev by Date: how to write this simple script command?
- Next by Date: Re: how to write this simple script command?
- Previous by thread: how to write this simple script command?
- Next by thread: Re: how to write this simple script command?
- Index(es):
Relevant Pages
|