nested if's in csh -- you need blanks!

idallen at watmath.UUCP idallen at watmath.UUCP
Fri Mar 2 13:25:02 AEST 1984


The routines that scan forward for a closing ENDIF (search and getword)
only recognize words separated by blanks and tabs, unlike the regular
parser, which breaks words on parentheses too.  So, you must say
	if ( ... ) then
		...
	endif
and not
	if( ... ) then
		...
	endif
or
	if ( ... )then
		...
	endif
Otherwise, the scan-forward routines can't find "if(" and ")then" to
nest the if's properly.  Either the regular parser should refuse to
accept "if(", or the scan-forward routines should duplicate the parser's
cleverness.  Considering the amount of double-parsing the CSH Shell
does already, you'd best vote for the first alternative!
-- 
        -IAN!  (Ian! D. Allen)      University of Waterloo



More information about the Comp.unix.wizards mailing list