LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-18-2003, 11:09 AM   #1
sikandar
Member
 
Registered: Aug 2003
Distribution: Linux AS & RH 9
Posts: 255

Rep: Reputation: 30
<< Eof ?


What is the usage of << EOF and EOF in the following block,


sqlplus "/ as sysdba" <<EOF
startup
EOF
 
Old 09-18-2003, 11:16 AM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 59
well i don't know what the actual command is for, but i would assume the first part will issue that command until the end of file and then when it reaches it, it then issues startup, and then the next one says that you reached the end of the actual file...
but that is just an assumption as i don't know what it is that you actually posted...
 
Old 09-18-2003, 11:19 AM   #3
sikandar
Member
 
Registered: Aug 2003
Distribution: Linux AS & RH 9
Posts: 255

Original Poster
Rep: Reputation: 30
This is a script to login to oracle instance and the startup the database.
 
Old 09-18-2003, 11:22 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
well it says that bash should pipe in the text between the two EOF's until it recieves the EOF (end of file) string itself, it's just a simple way of inputting a load of commands automatically.
 
Old 09-18-2003, 11:26 AM   #5
cnjohnson
Member
 
Registered: Nov 2002
Location: Nashville
Distribution: FreeBSD, Linux, OS-X
Posts: 544

Rep: Reputation: 30
If you want to try this for yourself to see how it work, get to a command line and type

cat <<EOF

Then type, say, 5 lines with whatever you want. Make the 6th line the three letters EOF

See what happens. This is a really cool dimension to shell scripts.

Cheers--
Charles
 
Old 09-18-2003, 11:39 AM   #6
sikandar
Member
 
Registered: Aug 2003
Distribution: Linux AS & RH 9
Posts: 255

Original Poster
Rep: Reputation: 30
What I got understanding that the "startup" has to be executed in the sqlplus window so to pass this parameter this technique is used. Secondly we may say it a loop?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
EOF finding Goblin_C_Noob Programming 7 09-10-2005 09:58 AM
finding the eof nodger Programming 12 11-26-2004 02:17 AM
Premature EOF? miknight Programming 1 04-04-2004 12:19 AM
eof ... c ... linux xviddivxoggmp3 Programming 6 03-31-2004 12:56 PM
Question about EOF (C) xailer Programming 6 12-07-2003 11:15 AM


All times are GMT -5. The time now is 12:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration