The following example shows the C shell commands that might be used on a UNIX system to give NDF-based applications access to a new data format. Typically, commands such as these would appear in a startup file, perhaps packaged as part of a ``driver'' that could be installed to give access to the data format in question:
# Ensure that the new format and its file extension are recognised on # input. if ($?NDF_FORMATS_IN) then setenv NDF_FORMATS_IN $NDF_FORMATS_IN',NEW(.new)' else setenv NDF_FORMATS_IN 'NEW(.new)' endif # Similarly, ensure they are recognised on output. if ($?NDF_FORMATS_OUT) then setenv NDF_FORMATS_OUT $NDF_FORMATS_OUT',NEW(.new)' else setenv NDF_FORMATS_OUT '.,NEW(.new)' endif # Define commands to convert from the new format to NDF format and # vice versa. setenv NDF_FROM_NEW 'new2ndf in='\'^dir^name^type\'' out='\'^ndf\' setenv NDF_TO_NEW 'ndf2new in='\'^ndf\'' out='\'^dir^name^type\'
This example illustrates a couple of points which were not addressed earlier:
Although the syntax needed is a bit messy, this does mean that any special characters that appear in dataset names will be handled correctly (i.e. literally), and not expanded by the shell that interprets the command.new2ndf in='^dir^name^type' out='^ndf'