rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Possibly very bad heredoc bug?
@ 1991-08-22  0:30 Mark-Jason Dominus
  0 siblings, 0 replies; only message in thread
From: Mark-Jason Dominus @ 1991-08-22  0:30 UTC (permalink / raw)
  To: rc; +Cc: mjd


	for (i in 1 2 3) {
		q=$i^bar
		echo $q $i
	}

produces output

	1bar 1
	2bar 2
	3bar 3

as we expect.  This is good.  However,

	for (i in 1 2 3) {
		q=$i^bar
		cat << EOF
		$i $q
	EOF
	}                    

produces

	3 3bar
	3 3bar
	3 3bar

which was not what I expected.  I expected the outputs to be the same.
Was I expecting the right thing or the wrong thing?

  The night is pleasing to us because, like memory, it erases idle details.
Mark-Jason Dominus 	  			    mjd@central.cis.upenn.edu 


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

only message in thread, other threads:[~1991-08-22  0:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-08-22  0:30 Possibly very bad heredoc bug? Mark-Jason Dominus

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