I have the following very simple code:
#!/usr/bin/env csh
set status=0
if ( 0 == 0 ) then
ls ./dummyDir
set status=$?
echo $status
endif
echo $status
And the problem is that the last echo of $status is 0 while the first one is set to exit code which is 2? Why is this happening? Why status is not modified inside if statement. The same equivalent of this in bash is perfectly working.