Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mailx input 3

Status
Not open for further replies.

immanuelsamuel

Technical User
Jul 9, 2001
17
0
0
GB
Hi

I have the following code in my shell script

mailx -s "$SUB" dpriest@dpyus.jnj.com << EOF_01
`echo $SUB 2>&1`
EOF_01

What is this EOF_01?

Regards
Immanuel
 
EOF_01 indicates the end of the commands initiated by <<EOF_01 in the script. Usually this is used to mimic entries which would need to be typed by users in an interactive session.
 
Thanks for the input, then what is the difference between EOF and EOF_01? Because usally I have seen EOF in the mailx examples.
 
None as far as I can see. Perhaps the author of the script wanted to differentiate between each separate EOF in it - not a bad idea for clarity.
 
Anyway, in your shell man page, have a look at Input/Output redirection.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
In the past, here's something that bit me: When using a unix "here" document, whatever you use for a command terminator, be careful not to place any inadvertent whitespace (such as a space or tab character) after it.

The shell doesn't recognize it as a terminator since the beginning character probably doesn't have it; but your programmer's eye ball doesn't see it.
 
In addition to olded's wise advice, also bear in mind that the command terminator must also start at the leftmost column of the line, and be the only command on the line, ie don't indent it for effect or 'readability', as it doesn't work if you do.
 
...unless you use <<-, in which case it doesn't mind if the line begins with tabs.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top