pub fn eval_expr(
expr: &TestExpr,
shell: &mut Shell<impl ShellExtensions>,
params: &ExecutionParameters,
) -> Result<bool, Error>Expand description
Evaluate the given test expression within the provided shell and execution context. Returns true if the expression evaluates to true, false otherwise.
§Arguments
expr- The test expression to evaluate.shell- The shell context in which to evaluate the expression.params- The execution parameters to use during evaluation.
§Errors
Returns error::ErrorKind::Unimplemented for unsupported predicates, an
error::ErrorKind::IoError if a file predicate cannot read metadata, or
any other error from evaluating a sub-expression.