Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Can not determine end-of-file error Post 302991703 by V1l1h1 on Wednesday 15th of February 2017 02:26:35 PM
Old 02-15-2017
Can not determine end-of-file error

Hello Experts,

I've used vi editor to write this script, provided permission, but I invoke it
it is prompting end-of-file errors.. I'm not sure what is causing that error..
would like some help.. I've attached details..


Code:
perseus.gasleak(/tmp/v_tst)% ls -l f2.sh
-rwxr-xr-x   1 gasleak       393 Feb 15 14:12 f2.sh
perseus.gasleak(/tmp/v_tst)% cat f2.sh
#!/bin/sh
#. /u01/app/oracle/local/bin/cron_env_$ORACLE_SID
file_name='./services.dat'
     if [ -f $file_name ]; then
       echo "file found " $file_name
       sqlplus /nolog <<EOF >./tst.log
       connect test/test
         set feedback off
         set echo on
         @./glspreltr.sql
       exit
       EOF
      fi
       mv $file_name $file_name_%m%d%Y
#       echo $file_name
perseus.gasleak(/tmp/v_tst)%
perseus.gasleak(/tmp/v_tst)% ./f2.sh
./f2.sh: syntax error at line 16: `end of file' unexpected
perseus.gasleak(/tmp/v_tst)%

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

End of file unexpected error

Hi, I am new to unix. I have written a script whenever i am giving sh filename.sh its prompting unexpected end of file in line number 40 in that line i have echo statement what do i need to do thanks in advance (5 Replies)
Discussion started by: hamsa
5 Replies

2. Shell Programming and Scripting

unexpected end of file error

hi, i am trying to connect to sqlplus in an 'if block' from the script. it is giving unexpected end of file error. and it works fine if it is out of 'if block'. if anybody have idea on this, can you please help me to solve the error ? piece of code is given below. if then... (11 Replies)
Discussion started by: vinayakatj56
11 Replies

3. Shell Programming and Scripting

unexpected end of file error

When I run the following script: #! /bin/bash for var in CA CC CD CT EC PC do cat << EOF > ${var}_full.dat echo T ${var}_high echo C age echo C sex echo C ht echo C WT_lg EOF cat << EOF > ${var}_agesex.dat ... (4 Replies)
Discussion started by: polly_falconer
4 Replies

4. Shell Programming and Scripting

syntax error: unexpected end of file

Hi, I have problem in constructing "IF" condition. The below code throws "tst.sh: line 10: syntax error: unexpected end of file" #!/bin/ksh test=9 echo $test if ] then echo "in" fi echo "end" exit 0 Actually, i want to check whether the variable $test is empty or null. ... (5 Replies)
Discussion started by: tinku
5 Replies

5. Shell Programming and Scripting

syntax error: unexpected end of file

Hi, I am newbie to UNIX scripting. I am facing this error "syntax error: unexpected end of file" while executing the following script: ------ a=$1 if then sqlplus -s prospect_stg/prospect_stg@mdmpt <<END insert into bckup_marc_parameter_lookup select * from... (6 Replies)
Discussion started by: boopathyvasagam
6 Replies

6. Shell Programming and Scripting

error unexpected end of file

Sometimes while unziping some files i got an error and the further unziping stopped.might be other files are able to be unzip.i.e gunzip a.Z b.Z c.Z gunzip: a.Z: unexpected end of file it found an error on a.Z and stopped but b.Z and C.Z might be correct. why this error comes and is... (2 Replies)
Discussion started by: malikshahid85
2 Replies

7. Shell Programming and Scripting

`end of file' unexpected error

When I am executing my really simple shell script below, I got an error: `end of file' unexpected. Script is suppose to print out a list of supplied parameters. Here is my script: #!/bin/sh a=$# #number or parameters b=0 #starting counter while do b=`expr $b + 1` echo... (9 Replies)
Discussion started by: alexstar
9 Replies

8. Shell Programming and Scripting

Unexpected end of file error

Hi , I am new to Unix and this is my first shell script . I am facing "unexpected end of file error" while executing my code . tried removing blank spaces Unable to trace out the error . PLease help !!! #!/bin/sh echo hello if ] echo hi then var=`cat liq_table_nm.txt` ... (6 Replies)
Discussion started by: sen180185
6 Replies

9. Shell Programming and Scripting

Unexpected End Of File Error

Hi guys, I am new to BASH scripting and I was wondering if anyone could have a look at this code and explain to me why I am getting an Unexpected End of File Error ? If you can that would be great / much appreciated! THANKS! #!/bin/bash USER="" PASS="" if ; then echo "You need to set... (1 Reply)
Discussion started by: spooke
1 Replies

10. Shell Programming and Scripting

IF section problem. syntax error: unexpected end of file error

Hello, I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time. My script: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if ; then echo "There is no errors in the logs" fi And after... (10 Replies)
Discussion started by: jedzio
10 Replies
Mail::Mbox::MessageParser::Cache(3)			User Contributed Perl Documentation		       Mail::Mbox::MessageParser::Cache(3)

NAME
Mail::Mbox::MessageParser::Cache - A cache-based mbox folder reader SYNOPSIS
#!/usr/bin/perl use Mail::Mbox::MessageParser; my $filename = 'mail/saved-mail'; my $filehandle = new FileHandle($filename); # Set up cache Mail::Mbox::MessageParser::SETUP_CACHE( { 'file_name' => '/tmp/cache' } ); my $folder_reader = new Mail::Mbox::MessageParser( { 'file_name' => $filename, 'file_handle' => $filehandle, 'enable_cache' => 1, } ); die $folder_reader unless ref $folder_reader; warn "No cached information" if $Mail::Mbox::MessageParser::Cache::UPDATING_CACHE; # Any newlines or such before the start of the first email my $prologue = $folder_reader->prologue; print $prologue; # This is the main loop. It's executed once for each email while(!$folder_reader->end_of_file()); { my $email = $folder_reader->read_next_email(); print $email; } DESCRIPTION
This module implements a cached-based mbox folder reader. It can only be used when cache information already exists. Users must not instantiate this class directly--use Mail::Mbox::MessageParser instead. The base MessageParser module will automatically manage the use of cache and non-cache implementations. METHODS AND FUNCTIONS The following methods and functions are specific to the Mail::Mbox::MessageParser::Cache package. For additional inherited ones, see the Mail::Mbox::MessageParser documentation. $ref = new( { 'file_name' => <mailbox file name>, 'file_handle' => <mailbox file handle>, }); <file_name> - The full filename of the mailbox <file_handle> - An opened file handle for the mailbox The constructor for the class takes two parameters. file_name is the filename of the mailbox. This will be used as the cache key, so it's important that it fully defines the path to the mailbox. The file_handle argument is the opened file handle to the mailbox. Both arguments are required. Returns a reference to a Mail::Mbox::MessageParser object, or a string describing the error. BUGS
No known bugs. Contact david@coppit.org for bug reports and suggestions. AUTHOR
David Coppit <david@coppit.org>. LICENSE
This software is distributed under the terms of the GPL. See the file "LICENSE" for more information. HISTORY
This code was originally part of the grepmail distribution. See http://grepmail.sf.net/ for previous versions of grepmail which included early versions of this code. SEE ALSO
Mail::Mbox::MessageParser perl v5.12.1 2009-08-09 Mail::Mbox::MessageParser::Cache(3)
All times are GMT -4. The time now is 09:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy