Sponsored Content
Full Discussion: Understanding <<EOF
Top Forums Shell Programming and Scripting Understanding <<EOF Post 302591624 by methyl on Friday 20th of January 2012 06:09:35 AM
Old 01-20-2012
You are using the Shell feature known as a "here-document". See the section about "<<" in the manual for your Shell.
The Shell will read up to the terminating word (which in your example is EOF) and present the contents on STDIN to the program which is reading from STDIN (which in your example is sqlplus).

EOF is a popular choice for the terminating word because it happens to be an acronym for End Of File and it does not occur as a command name in any mainstream computer language (including Oracle SQL). You will find on this board that many people use an exclamation mark for the terminating word. Those from a mainframe background sometimes use four asterisks because this was the convention on card-readers.

The code posted is a bit weird because the backticks are not needed or desirable. If the output was to be placed in an environment variable the backticks would be needed. There are a lot of examples on this board.

Personally I prefer to start the script with code to edit the SQL program and place the program into a file, then execute the program as a parameter to sqlplus. This makes debugging so much easier.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

EOF use

Hi, I'd like to access a windows directory from aix with samba client. To allow direct access (not interactive), i'm using EOF like: smbclient \\\\winserver\\windir 'passwd' -U usersmb << EOF cd subwindir put myfile EOF The access is correct but does somebody know how to trap errors... (1 Reply)
Discussion started by: jo_aze
1 Replies

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
TC(8)								       Linux								     TC(8)

NAME
choke - choose and keep scheduler SYNOPSIS
tc qdisc ... choke limit packets min packets max packets avpkt bytes burst packets [ ecn ] [ bandwidth rate ] probability chance DESCRIPTION
CHOKe (CHOose and Keep for responsive flows, CHOose and Kill for unresponsive flows) is a classless qdisc designed to both identify and penalize flows that monopolize the queue. CHOKe is a variation of RED, and the configuration is similar to RED. ALGORITHM
Once the queue hits a certain average length, a random packet is drawn from the queue. If both the to-be-queued and the drawn packet belong to the same flow, both packets are dropped. Otherwise, if the queue length is still below the maximum length, the new packet has a config- urable chance of being marked (which may mean dropped). If the queue length exceeds max, the new packet will always be marked (or dropped). If the queue length exceeds limit, the new packet is always dropped. The marking probability computation is the same as used by the RED qdisc. PARAMETERS
The parameters are the same as for RED, except that RED uses bytes whereas choke counts packets. See tc-red(8) for a description. SOURCE
o R. Pan, B. Prabhakar, and K. Psounis, "CHOKe, A Stateless Active Queue Management Scheme for Approximating Fair Bandwidth Alloca- tion", IEEE INFOCOM, 2000. o A. Tang, J. Wang, S. Low, "Understanding CHOKe: Throughput and Spatial Characteristics", IEEE/ACM Transactions on Networking, 2004 SEE ALSO
tc(8), tc-red(8) AUTHOR
sched_choke was contributed by Stephen Hemminger. iproute2 August 2011 TC(8)
All times are GMT -4. The time now is 05:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy