![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Check File Exists and compare to previous day file script | rbknisely | Shell Programming and Scripting | 3 | 02-07-2008 08:53 AM |
| how could I check whether ftp a file is successfully done or not | rinku | Shell Programming and Scripting | 1 | 11-19-2007 11:34 PM |
| how to search string and number in one file and check in the other file | knshree | Shell Programming and Scripting | 9 | 08-24-2007 01:29 AM |
| Have a shell script check for a file to exist before processing another file | heprox | Shell Programming and Scripting | 3 | 11-14-2006 12:26 AM |
| Script to check for a file, check for 2hrs. then quit | mmarsh | UNIX for Dummies Questions & Answers | 2 | 09-16-2005 11:46 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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? |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
You can get the octal value of the last character of a file with...
Code:
#! /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}'
|
|||
| Google The UNIX and Linux Forums |