c969c0d901f58b7047f7c5ed5bafb59c2d3bed07
galt
  Fri May 10 12:21:44 2013 -0700
tweaks to handle long list of blatservers
diff --git src/utils/qa/blatPing.csh src/utils/qa/blatPing.csh
index 0b4edc8..9743519 100755
--- src/utils/qa/blatPing.csh
+++ src/utils/qa/blatPing.csh
@@ -1,47 +1,52 @@
 #!/bin/tcsh
 source `which qaConfig.csh`
 
 cd ${HOME}
 
 if ( "$HOST" != "hgwdev" ) then
     echo "error: you must run this script on dev!"
     exit 1
 endif
 
 hgsql -h $sqlrr hgcentral -B -N -e "SELECT db, host, port FROM blatServers \
   ORDER BY db, host, port" > blatList
-set list = (`cat blatList`)
+
+#Need to do it in two steps so list is not too long giving word too long error.
+set list = (`head -100 blatList`)
+set list2 = (`tail --lines=+101 blatList`)
 
 # next line just for testing:
 #set list = (xx1 blat13 17779 xx2 blat14 17779 xx3 blat12 17779)
 set problems = ()
+while ( "$list2" != "" && "$list" != "" )
 while ( "$list" != "" )
     set db = $list[1]
     shift list
     set host = $list[1]
     shift list
     set port = $list[1]
     shift list
-    #-- use to remove monotonous long-running blat failures:
+	#-- use to remove monotonous long running blat failures:
     #if ("$db" != "rn2") then
      echo "$db $host $port"
      gfServer status $host $port > /dev/null
      set err = $status
      if ( $err ) then
  	echo "error $err on ${db} ${host}:${port}"
  	set problems = ($problems"${db} ${host}:${port}\n")
      endif
     #endif
 end
+    set list = ( $list2 )
+    set list2 = ()
+end
 echo
 echo "Summary:"
 if ( "$problems" != "") then
     echo "problems:"
     echo "$problems"
-    echo "$problems" | mail -s "BLAT ping failures." galt kuhn donnak
-    # use the next line to manually disable if too many failures annoying.
-    #mv blatPing.csh blatPing.csh.hold 
+    echo "$problems" | mail -s "BLAT ping failures." galt kuhn donnak ann rhead  # DEBUG RESTORE
 else
     echo "blat ping all ok."
     rm -f blatList
 endif