unexpeted EOF?

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

unexpeted EOF?

Postby 1slipperyfish » Sat Jan 07, 2006 7:31 pm

when i try to run lxprint i get this message
/home/paul/bin/lxprint: line 41: unexpected EOF while looking for matching `''
/home/paul/bin/lxprint: line 46: syntax error: unexpected end of file

the code is
Code: Select all
#!/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!"
   exit 0
fi

LATEXFILE="$1"

#If the filename supplied as an argument exists,
#then print it out.
if [ -f "$LATEXFILE" ]; then
   DVIFILE="$(echo "$LATEXFILE" | sed 's/tex$/dvi/')"
   latex "$LATEXFILE"
   dvips "$DVIFILE"
else
   #If the filename doesn't exist as supplied, see if
   #it's a base filename-- for example. if the user
   #supplied '02projections' as an argument and the file
   #print another file.
   
   if [ -f "{$LATEXFILE}1.tex"]; then
   #The variable COUNTER will hold the current number
   #in the sequence we're printing.We'll start at 1
   #and use expr to add one to it each time we
   #print another file.

      COUNTER=1

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

      else     
   echo "There doesn't seem to be a file called $LATEXFILE."
   exit 1
   
   fi
fi


it's probably just a typo as you know what i'm like :D
also if i put a ";" at the end of every line would this cause any problems?
any help would be greatly appreciated :D
paul
i am a follower of the culture

Image
User avatar
1slipperyfish
Forum Jester
 
Posts: 2432
Joined: Mon May 09, 2005 2:52 pm
Location: wigan

Postby dogsby » Sat Jan 07, 2006 7:47 pm

Are you missing a quote from the end of line 36?

Code: Select all
      echo "Printing $LATEXFILE$COUNTER.tex
dogsby
 
Posts: 14
Joined: Wed Sep 07, 2005 11:03 pm
Location: Kent

Postby 1slipperyfish » Sat Jan 07, 2006 8:04 pm

thankyou so much :D that's it :D i was going cross eyed looking for about an hour trying to find a typo :roll:
thanks agian
paul
i am a follower of the culture

Image
User avatar
1slipperyfish
Forum Jester
 
Posts: 2432
Joined: Mon May 09, 2005 2:52 pm
Location: wigan


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest