> for(var in `{ls /env}) {
> ifs=() contents = `{cat /env/$var}
> if (~ $var *#*) fn `{echo $var | awk '{split($0, a, "#"); print a[1]}'}
> {$contents}
> if not var = $contents
> }
pretty sure that's a syntax error. and for simple variables, quite
wrong. this function does better, but still screws up a few things.
v=() for(v in `{cd /env; ls -Q}){
if(~ $v *'#'*)
. /env/$v
if not x=() if(! ~ $v pid status '*' ifs){
# f015; plan 9 raw alt
ifs=() eval $v '= (' `{tr '\00' '' < /env/$v >/tmp/fubar ;
echo ' ,s:'':'''':g
,s::'' '':g
,s:(\n|[^])+:''&'':g
,s:: :g
,p' |
sam -d /tmp/fubar >[2=]
} ')'
}
}
the easy (and correct) answer is
exec rc
- erik