Imagine you have an application which could not process bad pixels. You could test whether a dataset might contain bad pixels, and run some pre-processing task to remove them first. This attribute could be inquired via ndftrace. If you need to know whether or not any were actually present, you should run setbad from KAPPA first.
setbad $file
ndftrace $file > /dev/null
set badpix = `parget bad ndftrace`
if ( badpix == "TRUE" ) then
<remove the bad pixels>
else
goto tidy
endif
<perform data processing>
tidy:
<tidy any temporary files, windows etc.>
exit
Here we also introduce the goto command--yes there really is
one. It is usually reserved for exiting (goto exit), or, as here,
moving to a named label. This lets us skip over some code, and move
directly to the closedown tidying operations. Notice the colon
terminating the label itself, and that it is absent from the goto
command.
C-shell Cookbook