From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Thu, 20 Apr 2006 05:36:48 -0500 To: 9fans@cse.psu.edu Subject: Re: [9fans] Install from CD fails MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 41a7f1aa-ead1-11e9-9d60-3106f5b1d025 perhaps you did things more elegantly than i. when i wrote my shell back when, getting this kind of stuff to work took quite a bit of effort fn f{ if($1) $2 } f {~ 1 1} {echo fu} - erik On Thu Apr 20 01:18:42 CDT 2006, forsyth@terzarima.net wrote: > > also, what does a traditional rc function do with a shell block? > > invoke it. i did something in a variant of 7th edition shell that was roughly similar. > i remember! i converted {block} as arguments into shell functions exported to the environment > (having added 8th edition style shell functions and exported shell functions to 7th edition shell). > the shell replaced the {} block by the function name before calling the command. > thus allowing > find usual-find-syntax -exec {mv $file /n/distant/$file} > where the modified find put the current name in the environment $file, removing the need for {} and the \; > find saw ... -exec my-exported-fn-name, and execvp would invoke /bin/sh -c my-exported-fn-name. > time {a | pipe | line}; nohup {another; sequence; of; commands} > this relied on the environment not being shared, of course > and having the source to 7th edition. >