Use local variables in preexec