[MITgcm-devel] testreport on sunos

Martin Losch Martin.Losch at awi.de
Wed Jun 25 03:12:33 EDT 2008


Hallo Jean-Michel,

there is a small problem with testreport on SunOS (rays1); and as  
usual the problem boils down to "awk". Obviously "awk" on linux  
systems is real "gawk". "gawk" has more features than awk and we are  
gettting so used to (g)awk that that we don't realize it's the  
"wrong" awk. Anyway, the SunOS-awk returns an error in line 229:
tst=`echo $sVar $listVar | awk '{ for(i=2;i<=NF;i++){t+=($i==$1)};  
print t }'`
and more specifically it is this part: ($i==$1) that awk does not  
recognize (gawk does, even on SunOS). What can we do?
1. Replace awk with gawk in this line? I am not sure that gawk is  
available on all systems.
2. replace all "awk"s with $AWK and set this or pass this as an  
argument?
3. I like best: find a syntax that SunOS awk can handle. I don't know  
what this line really does, and in particular, what t+=($i==$1) is  
supposed to do, but maybe there is a better way of doing this (with  
sed, which is more universal, as far as I remember from our problems  
with genmake2 years ago). Do you still have access to a Sun? If not,  
can you describe what this thing is supposed to do and I'll try to  
figure out how to do it on a Sun.

I believe there are still users on SunOS (there were some emails,  
recently), and this problem is likely to occur on other systems that  
do not run Linux (e.g. SX8, or IBM, ...)

Martin

PS. I don't think that this thing actually causes problems with  
testreport in my case (somehow emails don't get sent to  
jmc at mitgcm.org since last week), but it's still worth fixing.



More information about the MITgcm-devel mailing list