January 19, 201015 yr I've written a simple shell script command to join two files together using cat. From the command line I would write something like: cat fileA.txt >> fileB.txt My shell command, which compiles, is: RegisterGroovy( "AddToFile( addfrom ; addto )" ; "String[] cmd = ["cat", addfrom, ">>", addto];¶ Process process = Runtime.getRuntime().exec( cmd );¶ String processResult = process.getInputStream().getText();¶ process.waitFor();¶ exitValue = process.exitValue();¶ return processResult;" ) However, this merely returns the contents of each file and does not add the contents of fileA.txt to fileB.txt. Any thoughts?
Create an account or sign in to comment