Click to See Complete Forum and Search --> : LXPRINT script newb help required


Stumpers
09-17-2003, 08:58 AM
I am sure you lot can help me .

I am trying to write a bash shell script that, when run will go through all the LaTeX print processes. I have done this but now i want to make it so that i am only able to enter in .tex files. Maybe an echo message saying that i can only enter in .tex files

I realise that it will not work if i put in a .txt as an argument or anthing like that but it will then give me all sorts of errors which i do not want

this is my script so far
#!/bin/sh

if [ "$1" = --help ]; then
echo "use lxprint to print out LaTeX files in one easy step"
echo "Just supply the name of a .tex file as an argument"
echo " * or the base name of a numbered sequence of .tex files"
echo "to print them all"

fi

LATEXFILE- "$1"

if [-f "$LATEXFILE" }; then
DVIFILE="$(echo "LATEXFILE" | sed 's/tex$/dvi/')"
latex "$LATEXFILE"
dvips "$DVIFILE"

else

if [-f "${LATEXFILE}1.tex"]; then

COUNTER=1

while [ -f "$LATEXFILE$COUNTER.tex " ]; do
echo "Printing $LATEXFILE$COUNTER.tex"
latex "$LATEXFILE$COUNTER.tex"
dvips "$LATEXFILES$COUNTER.dvi"
COUNTER=$(expr $counter + 1)
done

else
echo "THere doesn;t seem to be a file called $LATEXFILE."
exit
fi
fi

hope there is enough info here