Let's back up a bit. Explain, in more abstract terms, what you're trying to accomplish. That may allow enough wiggle room to allow a Unixish solution.
I try to stay out of the wiggle room, myself. I find the jackets fit just a little too tight.
-jeff