It is currently Sat, 30 May 2020 13:30:29 GMT

Author Message
 cat << EOF
Just curious what this command does? I see it in code
as :

cat << EOF >> file


 Sat, 29 Jan 2005 11:57:29 GMT   
 cat << EOF
Submitted by "Mankind" to

It is often referred to as a "here-document".  The following
will put the three lines of text into a file called threelines:

cat > threelines <<EOT

Search the manual of the shell for "here-document" or "here

Andreas K?h?ri
Stable, secure, clean, free:

 Sat, 29 Jan 2005 12:16:12 GMT   
 cat << EOF

{any command} << MARKER

means take everything from the next line to MARKER as stdin for the


 Sun, 30 Jan 2005 03:44:23 GMT   
 cat << EOF

    Thanks from the peanut gallery, Victor.  I've been
trying to get a handle on  "here documents"  from the
Advanced Shell Scripting  guide,  but was lost until I read the above.....


 Sun, 30 Jan 2005 08:37:35 GMT   
 cat << EOF
On Wed, 14 Aug 2002 00:37:35 GMT, Bruce Burhans <>:

It's usually something like:

blah <<EOF

Meaning to take STDIN from the following lines up to "EOF".

Any technology distinguishable from magic is insufficiently advanced.
(*)  TopQuark Software & Services.  Contract programmer, server bum.
- -  Give up Spammers; I use procmail.
How to quote: (Ger.) (Eng.)

 Tue, 01 Feb 2005 09:30:39 GMT   
 cat << EOF

"Blah"  being an argument or option to the command?
Or piped input  or .....?


- Show quoted text -

 Tue, 01 Feb 2005 13:43:25 GMT   
 cat << EOF
Submitted by "Bruce Burhans" to

The first "blah" is the command, the "blah1", "blah2" and
"blah3" are three lines that will be sent to the STDIN of

Andreas K?h?ri
Stable, secure, clean, free:

 Tue, 01 Feb 2005 17:59:56 GMT   
 cat << EOF

Just make sure that there are no spaces/nulls after the EOF, otherwise
the script will keep going trying to find the 'EOF'.

Posted via

 Tue, 01 Feb 2005 20:24:06 GMT   
 cat << EOF

        So THAT'S  why comments (#) *after*  the 'EOF'
were showing up!  I deleted to the end of the line after
the 'EOF'  and they went away.   Thanks...
        But spaces and comments (#)  *before* the 'EOF'
still show up in at least some here-documents....
        Not, apparently, in  'anonymous' ( : )  ones....


 Wed, 02 Feb 2005 04:13:11 GMT   
   [ 9 post ] 

Similar Threads

1. Slack 1.1.2: /etc/rc.d "cat << EOF" wierdness

2. How can I trap a user in script <-<-<-<-<-<-<-<-

3. <<<<<soundconfig problem <<<<<<<

4. I think I've found the rectum of the internet.<<<<<<<<<<<<

5. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<?como?

6. C++ strings in i386<<FreeBSD<<C<<read()

7. IA32<<FreeBSD<<C++<<IPC

8. Question : : SOLARIS 2.3 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software