Need EOF usage in shell scripting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need EOF usage in shell scripting
# 1  
Old 08-05-2011
Need EOF usage in shell scripting

Hi all,

Can any one explain the usage of EOF in shell scripting??
Gone through some examples from google, but it is not clear...

Examples are:
1.
Code:
$ tr [a-z] [A-Z] << EOF
> abcd
> efgh
> iojk
> EOF

O/P is:
Code:
ABCD
EFGH
IOJK

2.
Code:
echo << EOF
> Hi
> How are u
> EOF

O/P:
No output here Smilie

Please some one explain the usage and purpose of EOF

Thanks

Last edited by pludi; 08-05-2011 at 03:46 AM..
# 2  
Old 08-05-2011
There is not "usage EOF" in shell programming. It is "here documents". You can read about it in any shell book or a long enough tutorial, for example: Here Documents
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

multiple if conditions and EOF in a shell script

I want to create an IF condition with multiple condition, in the statement below I want to add OR EOF, can any one please advise how to do. if } != $sample ] && ; then echo ..... fi code tags please (1 Reply)
Discussion started by: analyst
1 Replies

2. Shell Programming and Scripting

EOF Usage - line 56: syntax error: unexpected end of file

Below is a test script I'm writing in the process of learning to write script. When I try to run it I get an unexpected end of file error on line 56. Thoughts? SCRIPT: #!/bin/bash # system_page - A script to produce a system information HTML file ##### Constants TITLE="My System... (1 Reply)
Discussion started by: mpercy725
1 Replies

3. Shell Programming and Scripting

Oracle Shell script | here document `EOF' unclosed

Hi folks I m creating script which is give me below error. $ ./function.ksh ./function.ksh: here document `EOF' unclosed Inside the script is #!/bin/ksh export ORACLE_SID=OECDV1 export ORACLE_HOME=/u01/app/oracle/product/10.2.0 export PATH=$ORACLE_HOME/bin:$PATH echo "sql is... (3 Replies)
Discussion started by: tapia
3 Replies

4. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

5. Shell Programming and Scripting

usage...sed/awk/reg-exp ..in shell scripting

in shell scripting there is extensive usage of i> regular expression ii>sed iii>awk can anyone tell me the suitable contexts ...i mean which one is suitable for what kind of operation. like the reg-exp and sed seems to be doing the same job..i.e pattern matching (1 Reply)
Discussion started by: mobydick
1 Replies

6. UNIX for Dummies Questions & Answers

Usage of set in shell scripting

I am not able to understand the mentioned usage of set. $A set $l Please reply ASAP. Need to fix sth in my code. Thanks in advance. (0 Replies)
Discussion started by: trichyselva
0 Replies

7. Shell Programming and Scripting

Check EOF in shell script

Hi, I need to check whether one file has EOF or not. There's one daemon in our system, which will pick the files FTPed to us. However, sometimes the daemon picks the file before FTP is finished. So I'm planning to add some checking of EOF on the FTPed files in the shell script. Could... (8 Replies)
Discussion started by: ideazhcy
8 Replies

8. Shell Programming and Scripting

How to find EOF character in a Shell ?

Hi, I'm need to determine if a file contains the EOF character, how can I do that in Shell scripting? Regards. (1 Reply)
Discussion started by: jfortes
1 Replies

9. Shell Programming and Scripting

Awk scripting and usage of regex to locate a hyperlink

Hello guys, I need to write awk script that would take an html page and output a list of each unique http link on that webpage followed by the number of times it occurred in that file. e.g. ----------------------------------------- Webpage: index.html http://www.google.com/ 3... (1 Reply)
Discussion started by: grinch
1 Replies

10. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies
Login or Register to Ask a Question