From mboxrd@z Thu Jan 1 00:00:00 1970 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <56beac6b65153d337a33b24e20172a60@quanstro.net> References: <56beac6b65153d337a33b24e20172a60@quanstro.net> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <276D99AB-6285-4ED0-BEB6-6033428AD660@mac.com> Content-Transfer-Encoding: 7bit From: dave.l@mac.com Subject: Re: [9fans] late to the party - Here docs Date: Thu, 8 Nov 2007 00:37:17 +0000 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Topicbox-Message-UUID: eeeff00a-ead2-11e9-9d60-3106f5b1d025 > from your example, i'm not so sure why this > > { > echo select $blah blah';' > echo $imbibe_rat_urine > }|mysql --blah-blah > > is so terrible. > It's not, but it's still uglier ... > it turns out that you can use a here document in a loop > > ; for(i in 1 2 3) > cat < fu > ! > fu > fu > fu > Close, but no coconut. What does: for(i in 1 2 3) cat < but it doesn't work if you use curly braces > Yeesh! Nice detective work! I see from later detective work it does work, but not in an obvious way: IIRC sh slurped all the pending heredocs in orders when the lexer(!) saw an unquoted newline, which makes much more sense, but not in a syntactic way, IYSWIM. > since nobody's bothered to fix this, it's likely that it's just not > used > very much. > You're totally right. OTOH, looking at rc has given me a bit of a software itch ... I keep thinking "There's gotta be a neater/cleaner/faster way to do here documents, argument parsing, globbing, ...". My "need" for a plan9 system to scratch that itch is increasing:-) ... DaveL