I have an env variable that may or may not be set, if it is set then I want to check the path it holds exists.
Now I could do...
if ($?MYVAR) then
if -e $MYVAR then
etc.
endif
endif
but it would be nice to do;
if ($?MYVAR) && (-e $MYVAR) DoSomething
but that does not work if the var does not exist since it evaluates both conditions.
Is there a way I can do this in one statement? So something like;
if $?MYVAR if (-e $MYVAR) DoSomething
Now I could do...
if ($?MYVAR) then
if -e $MYVAR then
etc.
endif
endif
but it would be nice to do;
if ($?MYVAR) && (-e $MYVAR) DoSomething
but that does not work if the var does not exist since it evaluates both conditions.
Is there a way I can do this in one statement? So something like;
if $?MYVAR if (-e $MYVAR) DoSomething