for pp in 05 30 50 70 85 99 do case $pp in 99) tpp=100 ;; *) tpp=$pp ;; esac cat < stat$pp.ctl DSET ^stat${pp}.bin TITLE GSM stat 2012 ${tpp} hpa UNDEF -99999.0 OPTIONS yrev byteswapped XDEF 144 LINEAR 0.0 2.5 YDEF 73 LINEAR -90.0 2.5 ZDEF 1 LEVELS ${tpp}0 TDEF 1 LINEAR 00Z01JAN2012 1yr VARS 4 zmax 0 99 yearly maximum height zmin 0 99 yearly minimum height zavr 0 99 yearly average height pano 0 99 out of range probability ENDVARS GRADS done