[Swift-commit] r7759 - trunk/src/org/griphyn/vdl/karajan/lib/swiftscript

yadunandb at ci.uchicago.edu yadunandb at ci.uchicago.edu
Sat Apr 5 22:25:27 CDT 2014


Author: yadunandb
Date: 2014-04-05 22:25:26 -0500 (Sat, 05 Apr 2014)
New Revision: 7759

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
Log:
Fixing minor bug which strings passed to system builtin did not 
expand wildcards correctly as they would in a shell. So, pipes
are also working.

Tested with the following strings:

system("ls run*/*.log")
system("ls *"); #this doesn't give us a reasonable format
system("find *");
system("ls run???/*.???");
system("ls run???/*.??? | grep log");
system("find run* -type f");


Modified: trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2014-04-04 17:07:30 UTC (rev 7758)
+++ trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2014-04-06 03:25:26 UTC (rev 7759)
@@ -300,7 +300,7 @@
 		int i = 0;
 
 		try {
-		    proc = Runtime.getRuntime().exec(input);
+		    proc = Runtime.getRuntime().exec(new String[] {"bash", "-c", input});
 		    proc.waitFor();
             int exitcode = proc.exitValue();
             // If the shell returned a non-zero exit code, attempt to print stderr




More information about the Swift-commit mailing list