Savery Posted January 19, 2010 Posted January 19, 2010 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?
Recommended Posts
This topic is 5433 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now