EOF: text or control char

EOF: text or control char

Post by E.G. Thom » Sat, 17 Aug 1996 04:00:00



Since my department upgrade to Unix last May and paradoxically chose not
to spend any money on training, I've been giving myself a crash course,
self-taught (like almost everyone else) on administering a Unix machine.
I've been doing fine so far (thanks mostly to advice from Usenet gurus).
I do have one question however. What does the following mean:
        cat EOF>> filename

Is EOF actually text and Unix reads it as a control character? Or is that
really a code that means insert your system end-of-file control character
here? All the books and man pages I've read so far either assumes that
everyone has already taken several computer science courses and never
address this or too basic to even cover the topic.

May care go with you and Peace,
Emile G.

P.S.: if EOF is text, can you do the same thing with EOL?

 
 
 

EOF: text or control char

Post by Rich K » Sun, 18 Aug 1996 04:00:00




>>Since my department upgrade to Unix last May and paradoxically chose not
>>to spend any money on training, I've been giving myself a crash course,
>>self-taught (like almost everyone else) on administering a Unix machine.
>>I've been doing fine so far (thanks mostly to advice from Usenet gurus).
>>I do have one question however. What does the following mean:
>>        cat EOF>> filename

>>Is EOF actually text and Unix reads it as a control character? Or is that
>>really a code that means insert your system end-of-file control character
>>here? All the books and man pages I've read so far either assumes that
>>everyone has already taken several computer science courses and never
>>address this or too basic to even cover the topic.

>Unix doesn't use an end-of-file character in disk files, but maybe your
>application software does look for some sort of end-of-file marker.
>The command "cat EOF >> filename" would require a file named EOF, which
>might contain anything.

>--

>"Outside of a dog, a book is man's best friend.  Inside a dog, it's too
>dark to read." -- Marx (or was it Twain?)

 i am wondering if miniver miss understanding Here-document
 such as cat << "" EOF.

 rich

 
 
 

EOF: text or control char

Post by Bill Marc » Sun, 18 Aug 1996 04:00:00



>Since my department upgrade to Unix last May and paradoxically chose not
>to spend any money on training, I've been giving myself a crash course,
>self-taught (like almost everyone else) on administering a Unix machine.
>I've been doing fine so far (thanks mostly to advice from Usenet gurus).
>I do have one question however. What does the following mean:
>    cat EOF>> filename

>Is EOF actually text and Unix reads it as a control character? Or is that
>really a code that means insert your system end-of-file control character
>here? All the books and man pages I've read so far either assumes that
>everyone has already taken several computer science courses and never
>address this or too basic to even cover the topic.

Unix doesn't use an end-of-file character in disk files, but maybe your
application software does look for some sort of end-of-file marker.
The command "cat EOF >> filename" would require a file named EOF, which
might contain anything.

--

"Outside of a dog, a book is man's best friend.  Inside a dog, it's too
dark to read." -- Marx (or was it Twain?)

 
 
 

EOF: text or control char

Post by Roger Denhol » Tue, 20 Aug 1996 04:00:00


chop

Quote:> i wonder if miniver misunderstands Here-document
> such as cat << "" EOF.

> rich

The signal for EOF is ^D which is not appended in the file.  I wonder if
the original poster was  misdirected on EOF.
With hereis documents any end of text marker will do, so
long as the end of text is in the first column of a new line.
IMHO EOF is not a good choice.  EOT is my preference.
--

I do not speak for any Australian Govt department or body, including my own
 
 
 

EOF: text or control char

Post by Kurt J Lan » Tue, 20 Aug 1996 04:00:00



>Since my department upgrade to Unix last May and paradoxically chose not
>to spend any money on training, I've been giving myself a crash course,
>self-taught (like almost everyone else) on administering a Unix machine.
>I've been doing fine so far (thanks mostly to advice from Usenet gurus).
>I do have one question however. What does the following mean:
>    cat EOF>> filename
>Is EOF actually text and Unix reads it as a control character? Or is that
>really a code that means insert your system end-of-file control character
>here? All the books and man pages I've read so far either assumes that
>everyone has already taken several computer science courses and never
>address this or too basic to even cover the topic.

Actually it's pretty meaningless. It appears to say: append
the file named "EOF" to the file named "filename". If that's
what you are trying to do, fine. If your are trying to end
"filename", it's already done. There are no EOF characters
in unix files. The kernel knows exactly how many bytes are
in the file. Hope this helps.
--
--

 
 
 

EOF: text or control char

Post by Griff Mill » Wed, 21 Aug 1996 04:00:00





>>Since my department upgrade to Unix last May and paradoxically chose not
>>to spend any money on training, I've been giving myself a crash course,
>>self-taught (like almost everyone else) on administering a Unix machine.
>>I've been doing fine so far (thanks mostly to advice from Usenet gurus).
>>I do have one question however. What does the following mean:
>>        cat EOF>> filename

>>Is EOF actually text and Unix reads it as a control character? Or is that
>>really a code that means insert your system end-of-file control character
>>here? All the books and man pages I've read so far either assumes that
>>everyone has already taken several computer science courses and never
>>address this or too basic to even cover the topic.

>Actually it's pretty meaningless. It appears to say: append
>the file named "EOF" to the file named "filename". If that's
>what you are trying to do, fine. If your are trying to end
>"filename", it's already done. There are no EOF characters
>in unix files. The kernel knows exactly how many bytes are
>in the file. Hope this helps.

Maybe he's talking about a sh here document. The following sh script
fragment would append text to filename (or create filename if it didn't
exist):

cat <<EOF >>filename
These
lines
would
go
into
filename.
EOF

I realize that the way he wrote the example (cat EOF>> filename)
looks grammatically like something that would be typed on the command
line, but it also looks a lot like a typed-from-memory beginning of
a here document from a sh script.

FWIW

--
Griff Miller                         "Keep my mind on higher things; keep my
Systems Administrator   '95 Z-28      mind on truth."
Positron Corporation    '85 VF1100S

 
 
 

1. Redirected text file has weird control chars.

When I do this:  

man xdm > textfile  (replace 'xdm' with any unix man pg. entry)

I get weird control characters in textfile. I'm using a vt100
terminal telnet'ed to a UNIX system (and using csh). How do I
get "just" a text file?

If I printed this file on a postscript printer, would these
characters be interpreted as underlines and bold-characters?

Thanks.

--
David M. Jackson
Georgia Institute of Technology, Atlanta Georgia, 30332
uucp:     ...!{allegra,amd,hplabs,ut-ngp}!gatech!prism!gt1801a

2. Printing serially via a Terminal Server

3. get rid of control char in text file

4. Eye Candy

5. char *strcasestr(char *haystack, char *needle) a simple case independent strstr()

6. Iomega ZIP & mtools: partition=4 or 1?

7. Find a string in a text file and replace with another string to eof

8. Reprisal fears question

9. EOF, control Z, etc

10. how do i process each line in a text file until it reaches EOF?

11. What is the standard for unix text file EOF?

12. stray eof in a text file.