9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: sqweek <sqweek@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] here document
Date: Mon,  8 Oct 2007 15:46:36 +0800	[thread overview]
Message-ID: <140e7ec30710080046w452e1fabg195870ac3e5cc120@mail.gmail.com> (raw)
In-Reply-To: <F7A0F182-AA7C-4C19-81E4-ED7C1924A6E8@ar.aichi-u.ac.jp>

On 10/8/07, arisawa@ar.aichi-u.ac.jp <arisawa@ar.aichi-u.ac.jp> wrote:
> It seems "here document" in rc function is not working.
> Try:
>
> fn foo {
> cat <<'EOD'
> World
> EOD
> }
>
> echo Hello
> foo

 Your syntax is wrong. In rc the here document comes after the closing
brace, as in:

for(i in 1 2 3) {
cat <<EOF
}
Hello
EOF

 However, note the BUGS section of rc(1): "Functions that use here
documents don't work."
-sqweek


  reply	other threads:[~2007-10-08  7:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-04  1:51 [9fans] venti Russ Cox
2007-10-07 20:51 ` Steve Simon
2007-10-08  7:02   ` [9fans] here document arisawa
2007-10-08  7:46     ` sqweek [this message]
2007-10-08 11:59       ` arisawa
2007-10-08 12:12         ` erik quanstrom
2007-10-08 12:47           ` roger peppe
2007-10-08 13:09             ` erik quanstrom
2007-10-08 14:02               ` roger peppe
2007-10-08 15:14                 ` erik quanstrom
2007-10-08 16:34                   ` [9fans] International Workshop on Plan 9 Sape Mullender
2007-10-10  0:37         ` [9fans] here document Scott Schwartz
2007-10-10  0:46           ` erik quanstrom
2007-10-19  6:20             ` arisawa
2007-10-19 10:59               ` erik quanstrom
2007-10-19 12:44                 ` Martin Neubauer
2007-10-19 13:25                   ` erik quanstrom
2007-10-19 13:56                     ` Martin Neubauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=140e7ec30710080046w452e1fabg195870ac3e5cc120@mail.gmail.com \
    --to=sqweek@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).