Sponsored Content
Full Discussion: Unexpected eof error
Top Forums Shell Programming and Scripting Unexpected eof error Post 302157089 by thana on Thursday 10th of January 2008 04:53:25 AM
Old 01-10-2008
Unexpected eof error

Hi,
I am newbie and am just trying to connect to oracle from shell script ,,,but I am getting the following error

./prog.sh: line 20: syntax error: unexpected end of file

The scripts is :

#!/bin/bash
O=$IFS; IFS=",";
while read a b c d
do
echo $c
sqlplus -s training1/training1 << EOF
set serveroutput on;
BEGIN
DBMS_OUTPUT.PUT_LINE('IN SQL');
END;
/
quit;
EOF
done > file.txt

IFS=$O;


Can anyone help me
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

tar: write error: unexpected EOF

Hi friends, I am using Sun Solaris 5.9. I want to take backup of 3 folders which are 50 GB in size totally using tar command on tapes. I am having DAT 72 tape. After initiating tar command (tar -cvf /dev/rmt/0n /tmp/dir1/ /tmp/dir2/ /tmp/dir3/), tarring is stopped after 10 hrs (approx) and i am... (7 Replies)
Discussion started by: vijayakumar.pc
7 Replies

2. UNIX for Dummies Questions & Answers

tar: write error: unexpected EOF

I am taring to disk and get this message: tar: write error: unexpected EOF This message is normally associated with tape devices, not disk. Here is the syntax: tar -cf <tarfilename> /dir Have you seen this message on disk tars? (4 Replies)
Discussion started by: jabe
4 Replies

3. UNIX for Advanced & Expert Users

unexpected EOF

I ran the following scripts and everytime i get the errot as follows Line 54: unexpected EOF while looking for matching ',' line 57 syntex error unexpected end of file#!/bin/ksh set -x BKUP_DIR=/u03/backups/abu/nightly_backup LOG_FILE=/u03/backups/abu/backup.log ORACLE_HOME=... (9 Replies)
Discussion started by: manna
9 Replies

4. UNIX for Advanced & Expert Users

tar:read error: unexpected EOF

I need archive data from some tar files. I use the command "tar xvf filename". For about half of the files I get the error message "tar:read error: unexpected EOF". The number of bytes extracted comes very close to the size of the tar file. An example: 972434779 Jan 10 01:01... (4 Replies)
Discussion started by: mikeruth
4 Replies

5. UNIX for Dummies Questions & Answers

unexpected EOF

hello everyone...im having this problem with unexpected EOF with line 85 which is..i cant see whats wrong with it..can any1 plz help me out. read -p "$p1 please enter the number of tries you wish to have:" lifeline function main() { guessnum=0 read -p "Please enter if its sinle player game... (1 Reply)
Discussion started by: Freakhan
1 Replies

6. UNIX for Advanced & Expert Users

tar: write error: unexpected EOF

tar: write error: unexpected EOF I usually encounter this when I'm doing backup to Dat72 tape. Here's the command gzip all files in a directory then tar cvfp /dev/rmt/0n files. Not all files are copied. Any things I should look at? Directory size? ---------- Post updated at 05:20 PM... (1 Reply)
Discussion started by: lhareigh890
1 Replies

7. Shell Programming and Scripting

EOF Usage - line 56: syntax error: unexpected end of file

Below is a test script I'm writing in the process of learning to write script. When I try to run it I get an unexpected end of file error on line 56. Thoughts? SCRIPT: #!/bin/bash # system_page - A script to produce a system information HTML file ##### Constants TITLE="My System... (1 Reply)
Discussion started by: mpercy725
1 Replies

8. Shell Programming and Scripting

eof unexpected while looking[...]

Hello I use opensuse build service to build packages (oh surprise !) I have integrate a command in a spec whose worked and now this exit with: unexpected EOF while looking for matching `"' Command: if \.").mk ]; then ln -s $(pwd)/mozilla/security/coreconf/Linux2.6.mk \ ... (5 Replies)
Discussion started by: posophe
5 Replies

9. Shell Programming and Scripting

Help to resolve unexpected EOF while looking for matching `"' error

Hi, can someone kindly look into my copy script and figure out why am i getting a "unexpected EOF while looking for matching `"' error message #!/bin/ksh -x cd /home/goldenga/test/flag37 if ; then rm copied.ok cd /home/goldenga/test Upper=`ls -t|grep 'qw*'|cut -d "w" -f 2|head... (4 Replies)
Discussion started by: NDalal007
4 Replies

10. SCO

"Unexpected EOF within #IF, #ifdef or #ifndef" error when rebuilding / relinking SCO OpenServer 5

Hi, I am a new Unix Guru with very little experience but have the task of P2Ving an old HP Proliant ML370 G5 server to VMware ESX 4.1 or ESXi 5.5. System seems to boots fine but when trying to remove HP software, configure TCP/IP or a driver, I am receiving: -------- ... (7 Replies)
Discussion started by: dj_Italian
7 Replies
read(1)                                                            User Commands                                                           read(1)

NAME
read - read a line from standard input SYNOPSIS
/usr/bin/read [-r] var... sh read name... csh set variable = $< ksh read [ -prsu [n]] [ name ? prompt] [name...] DESCRIPTION
/usr/bin/read The read utility will read a single line from standard input. By default, unless the -r option is specified, backslash () acts as an escape character. If standard input is a terminal device and the invoking shell is interactive, read will prompt for a continuation line when: o The shell reads an input line ending with a backslash, unless the -r option is specified. o A here-document is not terminated after a NEWLINE character is entered. The line will be split into fields as in the shell. The first field will be assigned to the first variable var, the second field to the second variable var, and so forth. If there are fewer var operands specified than there are fields, the leftover fields and their interven- ing separators will be assigned to the last var. If there are fewer fields than vars, the remaining vars will be set to empty strings. The setting of variables specified by the var operands will affect the current shell execution environment. If it is called in a subshell or separate utility execution environment, such as one of the following: (read foo) nohup read ... find . -exec read ... ; it will not affect the shell variables in the caller's environment. The standard input must be a text file. sh One line is read from the standard input and, using the internal field separator, IFS (normally space or tab), to delimit word boundaries, the first word is assigned to the first name, the second word to the second name, and so on, with leftover words assigned to the last name. Lines can be continued using ewline. Characters other than NEWLINE can be quoted by preceding them with a backslash. These backslashes are removed before words are assigned to names, and no interpretation is done on the character that follows the backslash. The return code is 0, unless an end-of-file is encountered. csh The notation: set variable = $< loads one line of standard input as the value for variable. (See csh(1)). ksh The shell input mechanism. One line is read and is broken up into fields using the characters in IFS as separators. The escape character, (), is used to remove any special meaning for the next character and for line continuation. In raw mode, -r, the character is not treated specially. The first field is assigned to the first name, the second field to the second name, and so on, with leftover fields assigned to the last name. The -p option causes the input line to be taken from the input pipe of a process spawned by the shell using |&. If the -s flag is present, the input will be saved as a command in the history file. The flag -u can be used to specify a one digit file descriptor unit n to read from. The file descriptor can be opened with the exec special command. The default value of n is 0. If name is omitted, REPLY is used as the default name. The exit status is 0 unless the input file is not open for reading or an end-of-file is encoun- tered. An end-of-file with the -p option causes cleanup for this process so that another can be spawned. If the first argument contains a ?, the remainder of this word is used as a prompt on standard error when the shell is interactive. The exit status is 0 unless an end-of- file is encountered. OPTIONS
The following option is supported: -r Does not treat a backslash character in any special way. Considers each backslash to be part of the input line. OPERANDS
The following operand is supported: var The name of an existing or non-existing shell variable. EXAMPLES
Example 1: An example of the read command The following example for /usr/bin/read prints a file with the first field of each line moved to the end of the line: example% while read -r xx yy do printf "%s %s " "$yy" "$xx" done < input_file ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of read: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. IFS Determines the internal field separators used to delimit fields. PS2 Provides the prompt string that an interactive shell will write to standard error when a line ending with a backslash is read and the -r option was not specified, or if a here-document is not terminated after a newline character is entered. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 End-of-file was detected or an error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), ksh(1), line(1), set(1), sh(1), attributes(5), environ(5), standards(5) SunOS 5.10 28 Mar 1995 read(1)
All times are GMT -4. The time now is 12:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy