Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5433 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.