Checking for LOCAL_SCRATCH env variable and ...

... rerouting output if it exists.