How to check if the file DOES NOT have EOF

Hi,

Please help me on this.

how to check if the file DOES NOT have EOF ??

I am using ksh for this.

Windows text files have an EOF marker - ASCII 26.

UNIX files do not have an EOF marker like that. The filesystem keeps track of the length of the file. What problem are you trying to fix?

Actualy my problem is :
From windows machine they are ftp ing the text file.
UNIX server should have to read that file.
We are using shell script to read that file. but it is failing to read due to not able to find EOF ( file type problem)

My understanding is that While ftp ing from windows machine, they are ftping in binary mode instead of ascii mode.
so i have to write one more script to check EOF file is present or not in that ftp ed file.

You can get the octal value of the last character of a file with...

#! /bin/sh

file=$1

size=`ls -l $file | awk '{print $5}'`
dd if=$file bs=1 skip=`expr $size - 1` count=1 2>/dev/null \
        | od -b | awk '{print $2; exit 0}'

This should work in Bourne Shell, Korn Shell, bash, or anything else that claims to be somewhat compatible with Bourne shell.