added exec(cmd,output,input,error,avpenv) function for exec

`(*value).s` == `value->s`, the latter is more common.

Applies to this entire function.