9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* broken rc here documents.
@ 1997-07-08 18:49 erik
  0 siblings, 0 replies; only message in thread
From: erik @ 1997-07-08 18:49 UTC (permalink / raw)


>Hi,
>
>What should be the correct output for this rc fragment?
>
>{
>cat <<EOF
>hi there
>EOF
>}
>
>I'm getting
>
>hi: file does not exist
>EOF: file does not exist

the last time i tried writing a shell (1992) i decided that
here documents were *way* too much work when you consider the
simple quoting rules of rc (and other reasonable shells). all
you really need to do is replace each ' with '' and then put
the whole thing in 's. at one point i'd written a version of
shar that used exactly this trick but i seem to have lost it.

the point is: here documents are almost impossible to get
right so why not Just Use Quotes?

erik




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-07-08 18:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-07-08 18:49 broken rc here documents erik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).