logfile
is not an environment variable, so it doesn't exist in the shell started by the -exec
primary. You can either use setenv
:
setenv logfile "$HOME/LOG/output.log"
or change the quotes so that $logfile
is expanded before passing the command to csh
. It's not clear to me how $1
is supposed to be set, though.