From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 2 May 2013 11:24:27 -0400 To: 9fans@9fans.net Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] problem with a here document in rc Topicbox-Message-UUID: 50f023ba-ead8-11e9-9d60-3106f5b1d025 > s = (1 2) > for(i in $s) { > mkdir -p $i > cp POSCAR $i > @{ > cd $i > ed POSCAR <[2]/dev/null > } > } > 2c > $i > . > w > q i usually solve this problem like this for(i in 1 2){ mkdir -p $i || fatal cp POSCAR $i || fatal @{ { echo 2c echo $i echo . echo w echo q } | ed POSCAR } } - erik