1753804 Members
7386 Online
108805 Solutions
New Discussion юеВ

what mean <<EOF

 
SOLVED
Go to solution
Fernando Boza
Regular Advisor

what mean <<EOF

what mean <where I can get documentation for do and understand scripts?
4 REPLIES 4
smatador
Honored Contributor
Solution

Re: what mean <<EOF

Hi,
In fact EOF is just a flag word. You have an explanation here and some example
http://www.injunea.demon.co.uk/pages/page208.htm#11-2-1
For doing and understanding scripts, you could read the shell users guide
http://docs.hp.com/en/B2355-90046/index.html
Hope it helps
Fernando Boza
Regular Advisor

Re: what mean <<EOF

thanks
Michael Steele_2
Honored Contributor

Re: what mean <<EOF

Hi,

Well, its not <
If you have Oracle db, and refer to /sbin/init.d/database start / stop it will refer to a db.start / db.stop script under the oracle admin account. You'll see something like:

<<-EOF
svrmgrl
connect internal
shutdown immediate
EOF

Again, EOF ends the here-doc.
Support Fatherhood - Stop Family Law
OldSchool
Honored Contributor

Re: what mean <<EOF

Michael Steele: "Well, its not <
Close, but no cigar.

"<<[-]word
The shell input is read up to a line that matches word, or to an end-of-file. No parameter substitution, command substitution or file name generation is performed on word. The resulting document, called a here-document, becomes the standard input. If any character of word is quoted, no interpretation is placed upon the characters of the document. Otherwise, parameter and command substitution occurs, \newline is ignored, and \ must be used to quote the characters \, $, `, and the first character of word. If - is appended to <<, all leading tabs are stripped from word and from the document."


Applies to posix "sh", bash, ksh (and derivatives), bash, and others.

In all of the shells noted, the "-" is always optional, and if used, strips leading "tabs" out of the input, allowing for indentation in the script.