title: complex bash functions: correct usage?
body: <p><br/>
  I'm interested in automating daily tasks. Until recently, every part of one of my scripts was running smoothly. But now I was trying to implement zenity and everything fell apart. Now I'm hoping you can take a look what I'm doing wrong.</p>
  
  <p>Soo, coming to a point: I'm having a cruel bash script, looking like this:</p>
  
  <pre><code>#!/bin/bash
  
  dosomething () {
    # code
    echo $1 &gt;&gt; ~/test.txt # For debugging
    $1 &amp; # ← Important line
    # more code
  }
  
  main () {
    # other code
    dosomething "/usr/bin/rsync $rsync_options" # ← Call it "do_1"
    dosomething "/usr/bin/find $findme_path -iname \"*.gpx\" -print0 | xargs -0 $other_command" # ← Call it "do_2"
    # another code
  }
  
  ( main | (zenity --progress $zenity_options || $still_another_command ) &amp;
  </code></pre>
  
  <p>What (should) happen: The output of main is piped to zenity (progress bar). main does not really execute any command, but calls dosomething with a parameter, which contains the command to be executed. dosomething executes the command.</p>
  
  <p>What really happens: The "echo" part of dosomething works like expected. After the script has been executed, the commands in do_1 and do_2 correctly appear in ~/test.txt. (If I copy&amp;pasted the contents of ~/test.txt in my terminal, every command was executed with the expected results.)<br/>The "Important line" of "do_1" is executed with the expected results. But the "Important line" of "do_2" seems to have no effect. At least, I can see no effects of $other_command after executing the script.</p>
  
  <p>I hope you can at least understand what I mean. It would be very kind of you if you gave me a hint what goes wrong in here.</p>