[Swift-commit] r5088 - usertools/persistent-coasters

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Thu Sep 8 09:53:51 CDT 2011


Author: wozniak
Date: 2011-09-08 09:53:51 -0500 (Thu, 08 Sep 2011)
New Revision: 5088

Modified:
   usertools/persistent-coasters/helpers.zsh
Log:
Copy in cqda() and zclm()


Modified: usertools/persistent-coasters/helpers.zsh
===================================================================
--- usertools/persistent-coasters/helpers.zsh	2011-09-08 01:21:11 UTC (rev 5087)
+++ usertools/persistent-coasters/helpers.zsh	2011-09-08 14:53:51 UTC (rev 5088)
@@ -33,6 +33,38 @@
   return 0
 }
 
+cqda() 
+# Delete all Cobalt jobs
+{
+  local JOBS
+  JOBS=($( qstat | grep wozniak | clm 1 )) 
+  (( ! ${#JOBS} )) && return 0
+  qdel ${JOBS}
+}
+
+zclm()
+# Z-CoLuMn
+# Select columns from input without awk/cut
+{
+  local L
+  local -Z c
+  local A C i
+  C=( ${*} )
+  while read L
+  do
+    A=( $( print -- ${L} ) )
+    N=${#C}
+    for (( i=1 ; i<=N ; i++ ))
+    do
+      c=${C[i]}
+      printf "${A[c]}"
+      (( i < N )) && printf " "
+    done
+    printf "\n"
+  done
+  return 0
+}
+
 bail()
 {
   CODE=$1




More information about the Swift-commit mailing list