> i'd rather have if's $status visible only to the first statement following
> it,
> for example:
>
> if (foo | bar | baz) { # sets $status
> if (! ~ $status ....) { # uses $status
> handle_particular_kind_of_pipeline_failure
> }
> do_other_stuff # should not be affected
> }
> do_yet_other_stuff # should not be affected either
>
>
> ...but guess rc's semantics are almost set in stone by now :-)
the status is only visible to the first *executed* statement.
remember, rc at heart is a virtual machine.
since the argument of if is always executed before the branch,
the status of cmd1 in "if(cond)cmd1" is by definition ''.
to take this to its logical conclusion, consider this code
if(~ 0 1){
}
if not{
}
echo $status
it prints "no match".
- erik