[Swift-commit] r7826 - SwiftApps/swift-galaxy/swift

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Tue May 6 13:50:56 CDT 2014


Author: ketan
Date: 2014-05-06 13:50:56 -0500 (Tue, 06 May 2014)
New Revision: 7826

Modified:
   SwiftApps/swift-galaxy/swift/swiftforeach.sh
Log:
take care of list and range for T

Modified: SwiftApps/swift-galaxy/swift/swiftforeach.sh
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeach.sh	2014-05-06 18:30:03 UTC (rev 7825)
+++ SwiftApps/swift-galaxy/swift/swiftforeach.sh	2014-05-06 18:50:56 UTC (rev 7826)
@@ -26,7 +26,7 @@
 stdin=$1
 shift
 
-if [ "$range_or_list" == "list" ] ; then
+if [ "$range_or_list" = "list" ] ; then
     listfile=$1
     shift
     n=$(wc -l < $listfile)
@@ -214,12 +214,18 @@
  $stdinfilexpr
  
  file exec=input("$executable");
- file listfile=input("$listfile");
-
- string list[] = split(read(listfile),"\n");
- foreach l, i in list{
-     file out <sprintf("$outloc/%s.%i.out", l, i)>;
-     file err <sprintf("$outloc/%s.%i.err", l, i)>;
+ $( if [ "$range_or_list" = "list" ] ; then
+  echo "file listfile=input("$listfile");"
+  echo "string list[] = split(read(listfile),"\n");"
+  echo "foreach l, i in list{"
+  echo "file out <sprintf(\"$outloc/%s.%i.out\", l, i)>;"
+  echo "file err <sprintf(\"$outloc/%s.%i.err\", l, i)>;"
+ else
+  echo "foreach i in [$rstart:$rend:$stepsize]{"
+  echo "file out <sprintf(\"$outloc/%i.out\", i)>;"
+  echo "file err <sprintf(\"$outloc/%i.err\", i)>;"
+ fi
+ )
      (out,err) = anapp(exec, i, stringargs, fileargs, stdinfile);
  }
  printf("%s", "Done!");




More information about the Swift-commit mailing list