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

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Tue May 6 12:04:31 CDT 2014


Author: ketan
Date: 2014-05-06 12:04:31 -0500 (Tue, 06 May 2014)
New Revision: 7823

Modified:
   SwiftApps/swift-galaxy/swift/swiftforeach.sh
   SwiftApps/swift-galaxy/swift/test.sh
Log:
improve T script gen

Modified: SwiftApps/swift-galaxy/swift/swiftforeach.sh
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeach.sh	2014-05-06 16:22:32 UTC (rev 7822)
+++ SwiftApps/swift-galaxy/swift/swiftforeach.sh	2014-05-06 17:04:31 UTC (rev 7823)
@@ -191,23 +191,28 @@
  */
  
  import files;
+ import string;
+ import io;
  
  app (file _out, file _err) anapp(file _exec, int _i, string _stringargs[], file _fileargs[], file _stdin){
-     $interpreter _exec _i _stringargs _fileargs @stdin=_stdin @stdout=_out @stderr=_err;
+     "$interpreter" _exec _i _stringargs _fileargs @stdin=_stdin @stdout=_out @stderr=_err;
  }
 
+main{
  $stringarrayexpr
  $filearrayexpr
  $stdinfilexpr
  
- file exec<"$executable">;
- file listfile<"$listfile">;
+ file exec=input_file("$executable");
+ file listfile=input_file("$listfile");
+
  string list[] = split(read(input_file(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)>;
      (out,err) = anapp(exec, i, stringargs, fileargs, stdinfile);
  }
+ }
 EOF
  
  stc=$(which stc)

Modified: SwiftApps/swift-galaxy/swift/test.sh
===================================================================
--- SwiftApps/swift-galaxy/swift/test.sh	2014-05-06 16:22:32 UTC (rev 7822)
+++ SwiftApps/swift-galaxy/swift/test.sh	2014-05-06 17:04:31 UTC (rev 7823)
@@ -2,6 +2,20 @@
 
 #!/bin/bash
 
+cat << EOF > list.txt
+a
+b
+c
+EOF
+
+cat << EOF > x.sh
+#!/bin/bash
+
+echo $@
+EOF
+
+chmod 755 x.sh
+
 echo "List, no input parameters and files"
 ./swiftforeach.sh list swiftK localhost "" bash x.sh "" list.txt tmpoutlist a.log list1.out ""
 




More information about the Swift-commit mailing list