Reverted changes from previous #2786 commit (closes #2786)

In order to circumvent shell interpolation and evaluation, the command
is now written to a temporary script that is executed. This allows to
properly isolate the command and our shell redirects around it.
Merge pull request #67 from eguaj/1.4-A2786

Reverted changes from previous #2786 commit (closes #2786)