9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] rc funny - still perplexed
@ 2003-01-03 16:20 steve.simon
  0 siblings, 0 replies; 2+ messages in thread
From: steve.simon @ 2003-01-03 16:20 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]


Thanks for the help Russ,

You  are quite correct - the EOF must go in the first collumn, however I still
get weird results,
simplified script below - I would expect it to print ls twice, but it prints it
once and gives
a directory listing the second time!

-Steve



 

[-- Attachment #2: Junk --]
[-- Type: application/octet-stream, Size: 99 bytes --]

#!/bin/rc

########

cat << 'EOF1'
	/bin/ls -l
EOF1


########

{
	cat << 'EOF2'
		ls | mc
}
EOF2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] rc funny - still perplexed
@ 2003-01-03 16:27 Russ Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Russ Cox @ 2003-01-03 16:27 UTC (permalink / raw)
  To: 9fans

Perhaps I wasn't clear.  It's not just
that EOF2 has to go in the first column.
The here document does not start until all the
braces close.

If you want the second example to print "ls | mc"
rather than run that command, you have to say

{
	cat <<'EOF2'
	other commands here
}
# here document for cat starts here
ls | mc
EOF2



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-03 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-03 16:20 [9fans] rc funny - still perplexed steve.simon
2003-01-03 16:27 Russ Cox

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).