This question is a variation of this.
In my case, the command has an argument. For example, suppose I processing sample.tex with texlive, to generate a dvi, ps and pdf respectively. The commands will be
latex sample.tex
bibtex sample.aux
latex samlpe.tex
dvips sample.dvi
ps2pdf sample.ps
Can I merge them together to a script file so that whenever I enter
makepdf sample.tex
all the above commands are executed sequentially, so that I get a pdf.