title: how to call shell commands from groovy correctly
body: <p>i want to execute shell commands from my groovy  script.
  I tested the following:</p>
  
  <pre><code>"mkdir testdir".execute()
  </code></pre>
  
  <p>and this just  works fine.
  Now i wanted to make a file, write something to the file and then open a text editor to view the  file.</p>
  
  <pre><code>def execute(cmd) {
     def proc =  cmd.execute()
     proc.waitFor()
  }
  
  execute("touch file")
  execute("echo hello &gt; file")
  execute("gedit file")
  </code></pre>
  
  <p>Now gedit  opens correctly but ther is no "hello" string in the file.
  How is this working?!?</p>