in reply to system stdout redirected ok to a file but not to a variable.
What specifically happens? What error message(s) do you get?