How to execute standard output ?

Alright so i got this script genpipe:

echo "$*" |sh genscript file
vi file << 'HERE'
:%s/^/echo /g
:%s/ $//g
:%s/[0-9] /&\| xargs \.\/plus /g
:wq
HERE
cat file

Which generates output like echo 1 | xargs ./plus 2 | xargs ./plus 3 and so on

Now i got the next script multiplus, who should actually execute the output of genpipe. (the plus script just adds the input to output)

So in my exemple multiplus should generate 6 as output, but instead of that i got echo 1 | xargs ./plus 2 | xargs ./plus 3

So how do i actually make the output work as a command on the command line ?

 
$(write_cmd_process)

so i should replace
write_cmd_process

by my commands i want to execute ?

Yes, $() is nice because of vi % support and nesting without escapes. But you can also say eval or `cmd` or "echo 'cmd' | ksh". Sometimes it is good to be in the same ksh instance. Eval does an extra pass of command line interpretation:

$ eval echo '$'$#
-ksh
$

$#=0 so $0 is -ksh