I'll apologise in advance, I'm new to groovy. The problem I have is I have 3 groovy scripts which perform different functionality, and I need to call them from my main groovy script, using the output from script 1 as input for script 2 and script 2's output as input for script 3.

I've tried the following code:

```
script = new GroovyShell(binding)
script.run(new File("script1.groovy"), "--p",  "$var" ) | script.run(new File("script2.groovy"), "<",  "$var" )

```

When I run the above code the first script runs successfully but the 2nd doesn't run at all.

Script 1 takes an int as a parameter using the `"--p", "$var"` code. This runs successfully in the main script using: `script.run(new File("script1.groovy"), "--p", "$var" )` - Script 1's output is an xml file.

When I run `script.run(new File("script2.groovy"), "<", "$var" )` on its own in the main groovy script nothing happens and the system hangs.

I can run script 2 from the command line using `groovy script2.groovy < input_file` and it works fine.

Any help would be greatly appreciated.