Since no one answered for a day i'm going to take a shot:
The first impulsive Answer would be: "You shouldn't do that". It doesn't really match with the goals of Unittesting (e.g. it's not really fast to run that test).
If you're writing a Test for a Class that calls that Script your not really testing one thing but two. The Class that calls the command line Script and that Script it's self and you could mock out the shell part.
If you're just trying to make sure that exec works my first idea would be to build your Test in a way that doesn't spawn that shell process as a background Task but as a Foreground Task and eliminating the need for some "wait" workaround.
Hope that helped a litte