only test for run from file if possible, eliminate unnecessary subshell