Can sh or csh do this VMS DCL trick??

andre andre at targon.UUCP
Fri May 3 06:20:38 AEST 1991


In article <DAVIS.91Apr27183503 at pacific.mps.ohio-state.edu> davis at pacific.mps.ohio-state.edu  (John E. Davis) writes:

 >  In VMS DCL I can do:
 >
 >     $ create post_news.txt
 >     $ deck
 >        Hi,
 >     $ eod
 >     $ exit
 > How can I simulate this behavior in csh or sh?  Solutions
 >requiring two files are not acceptable.

Easy, use a "here document" like:

$ mail foo <<eod
> hi
> etc...
>eod

and everything between the command and the first line that
starts with eod is taken as stdin of mail. (you can also use <<!
for brevity).

-- 
The mail|    AAA         DDDD  It's not the kill, but the thrill of the chase.
demon...|   AA AAvv   vvDD  DD        Ketchup is a vegetable.
hits!.@&|  AAAAAAAvv vvDD  DD                    {nixbur|nixtor}!adalen.via
--more--| AAA   AAAvvvDDDDDD    Andre van Dalen, uunet!hp4nl!targon!andre



More information about the Comp.unix.questions mailing list