Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unexpected und of file in Vi 1

Status
Not open for further replies.

linmatt

Technical User
May 22, 2002
50
GB
Hi - back again

I've just started getting an Unexpected End Of File error when running the script. Everything now works fine, except this. And it's on the row below the last row. With numbering on, the script ends at line 69, but the error is line 70. It's only started in the last 15 mins, and I don't know why.

Anyone understand this?

matt
 
I think the problem lies with a missing final "\n". This might fix the problem:
Open the file in vi, press shift-G, then o, then ESC, then dd. Save, and quit.
Hope this helps, cheers Neil :)

 
A symptom of this problem will be the warning message:
[Incomplete last line]
When opening the file in vi.
Cheers, Neil
 
No, sorry - it still gives the same Syntax error. I've checked all the do...done stuff, compared it to a print of the working version - no change. I'm baffled, it's got to be there somewhere.
 
Have you checked each if has a closing fi, and each case has a closing esac?
 
There's only one 'if' and it does indeed have an 'fi' at the end, and no case statements. I'd though of that. Looked at in in WinVi as well - just though it might help - no joy. I may copy the text to a new file and see if that helps.
 
Did you try od -c <filemame> to see what exactly is in the file? It should probably end with a \n & then a blank line (don't know why od puts this final blank line in but it seems to ...)

You've probably fixed it by now anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top