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, [EMAIL PROTECTED] 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.
>