Hi.
Using other
csh /
tcsh constructs:
Code:
#!/bin/tcsh
# @(#) s1 Demonstrate csh variable contents test.
echo "checking length of name"
if ( ${?name} == 0 ) then
echo " Variable name is not set."
endif
# NOTE - $ % construct tcsh only.
set name
if ( ${%name} == 0 ) then
echo " Variable name has 0 characters as value."
endif
# if( "$nmlfilelist" == "" ) then
if( "${?nmlfilelist}" == 0 ) then
echo "nmllist is empty"
exit( 1 )
endif
exit 0
Produces:
Code:
% ./s1
checking length of name
Variable name is not set.
Variable name has 0 characters as value.
nmllist is empty
Best wishes ... cheers, drl
_____
Standard advice: avoid csh family for scripting.