9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] problem with a here document in rc
@ 2013-05-02 13:22 Rudolf Sykora
  2013-05-02 15:24 ` erik quanstrom
  0 siblings, 1 reply; 9+ messages in thread
From: Rudolf Sykora @ 2013-05-02 13:22 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

I have a problem with writing correctly a here document in rc.
I wrote, say:

s = (1 2)
for(i in $s) {
	mkdir -p $i
	cp POSCAR $i
	@{
		cd $i
		ed POSCAR <<EOF >[2]/dev/null
	}
}
2c
$i
.
w
q
EOF

and I wanted to have the 2nd line of individual POSCAR files replaced
with the immediate value of $i.
But the script doesn't do it, and I don't know if it can be modified
in a simple way so that it did.
(I could possibly use sed [ie. without a here document] but ...)

If anyone can tell me...
Thanks!
Ruda



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

end of thread, other threads:[~2013-05-08  3:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-02 13:22 [9fans] problem with a here document in rc Rudolf Sykora
2013-05-02 15:24 ` erik quanstrom
2013-05-02 15:48   ` Rudolf Sykora
2013-05-06  7:27     ` Rudolf Sykora
2013-05-06 13:37       ` erik quanstrom
2013-05-07 20:40       ` Martin Kühl
2013-05-07 22:08         ` erik quanstrom
2013-05-08  2:53           ` Martin Kühl
2013-05-08  3:02             ` erik quanstrom

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