Premature EOF


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Premature EOF
# 1  
Old 12-26-2005
Premature EOF

How to check for a premature EOF in a regular file in a shell/perl script?
I want to check if I have received a complete file or not.

Thanks,
Rahul.
# 2  
Old 12-27-2005
Why not use checksum ?
# 3  
Old 12-27-2005
here is one more,

have a trailer record for each of the file you are receiving
(just including a single line is not going to affect the receiving file size)
trailer record to contain no of records in the file

existence of trailer indicates complete file transfer
# 4  
Old 12-30-2005
But How?

Vino,

How to use checksum? When i type checksum on my command prompt, it says command not found. I am using a Sun Solaris 5.8

Madhan,

I am using wget to grab the webpage running on Windows server. What the following command does is create a file with the webpage URL name in my current directory.

wget -nv -o /tmp/wget.csv.log -t 5 -w 10 http://vpcmsa06/qos/1HRScsv.asp

Now, Without doing any modification to this file i.e http://vpcmsa06/qos/1HRScsv.asp, I want to check if it has a premature EOF.

Any advise would be helpful.

Thanks,
Rahul.
# 5  
Old 12-30-2005
i understand that the modification to the existing asp file would not be possible

instead, is it possible to idenitfy the start and end of the file with markers
just as we do in html pages ?

(ex only)
<HTML>
</HTML>

but i am not sure how far this could be made use of ....
its just an example or kind of way proceeding with that.
# 6  
Old 12-30-2005
No Specific Markers

These files will not have any specific start or end markers and hence I am unable to do a premature EOF check.

Thanks,
Rahul.
# 7  
Old 12-30-2005
I will still stick to Vino. If you have a way to get the checksums of the file from the place where you are getting it, then you can run the command cksum on the received file, and then match the two. cksum is one of the surest way to convince that the file received is complete and exactly the same as one that is sent.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

confused with << EOF EOF

Hi friends , I am confused with << EOF EOF Most of the cases I found sqlplus $db_conn_str << EOF some sql staments EOF another exapmle is #!/bin/sh echo -n 'what is the value? ' read value sed 's/XXX/'$value'/' <<EOF The value is XXX EOF (1 Reply)
Discussion started by: imipsita.rath
1 Replies

2. Shell Programming and Scripting

Until eof do????

Hey! Can I write a routine that allows me to in a txt file check line by line until the end of file? something like until do ---some code--- done maybe it is a stupid question but I never learned shell scripts and I need this :p thanks in advance (1 Reply)
Discussion started by: ruben.rodrigues
1 Replies

3. Programming

Eof

How can I write EOF into a file? I tryed to do as follows: size=sizeof(EOF); end_of_file=EOF; write(fdMutexRichieste, &end_of_file, size); But it does non work correctly, becouse in the next cicle (using lseek(..., SEEK_END) of my code it seems to ignore my EOF and use the LAST... (5 Replies)
Discussion started by: DNAx86
5 Replies

4. Shell Programming and Scripting

What is << EOF

I'm trying to connect to oracle with the following code in the script: checksqlerror{ if echo $1 exit fi } $SQLPLUS username/password@schemaname checksqlerror "failed to connect to oracle" If I'm passing wrong schema name,instead of executing checksqlerror it stops and expects user... (2 Replies)
Discussion started by: BhawanaAggarwal
2 Replies

5. UNIX for Dummies Questions & Answers

\n after EOF

Hello all, I have unix file that ends with the following EOF '9999999999' I want to remove the '\n' character after EOF. What is the command that should be included in the script, before sending the file? will this work: $ echo "<99999999999>\c" >> <filename> thanks in advance. (3 Replies)
Discussion started by: priya12
3 Replies

6. Shell Programming and Scripting

Eof

hi, in a shell script i came accross the following bit of code 1.shift $(($OPTIND - 1)) 2.if ; then 3. cat << EOF >&2 4.Usage: $0 lockfilename 5.EOF 6. exit 1 7.fi I am not able to understand the meaning of lines(1,3,5). Can any one of u tell me the purpose of above said lines.... (1 Reply)
Discussion started by: ravi raj kumar
1 Replies

7. UNIX for Dummies Questions & Answers

Eof

I have written this code: code echo 'Now choose the file or files you want to merge your input with: \c' read filenames filelist="" for file in $filenames; do filelist="$filelist $file" done echo "Now that you've chosen these files ($filelist), please start typing: " until ; do paste -... (2 Replies)
Discussion started by: fiol73
2 Replies

8. UNIX for Dummies Questions & Answers

Eof

hello all, how end of a file is detected in UNIX system? does it make use of any special symbols to identify the EOF? :( thank you all (5 Replies)
Discussion started by: compbug
5 Replies

9. Shell Programming and Scripting

Please help with EOF

Hello, you are an awesome crowd! You answered my last questions, thank you sooo much! I am trying to write a korn shell script that will record the memory my application is using (HP-UX B.11.11) and I have this: if (( $APP > $THRESHOLD )) then echo "Warning message will display" cat... (2 Replies)
Discussion started by: satraver
2 Replies
Login or Register to Ask a Question