Experiment with script command instead of piped tee in executeCommand function