2015-09-23 5:46 GMT+02:00 HP Wei :
> My original issue was to construct the string “cmd1 -a A -b B” and “cmd2 -c
> C”
> in a flexible way so that I can choose to supply (or not supply) those
> argument A, B, C.
> And find a clean way to put everything together into { … } for
>
> Your suggestion in another email of implementing >process looks
> interesting to explore.
> Any example usage in this case ?
>
Not really, I'm afraid. The only two implemented methods are here:
https://github.com/slavapestov/factor/blob/master/basis/io/launcher/launcher.factor#L118-L122
It
Thanks, Alex, for pointing out the the ‘make’ word, which is something new to
me.
I will study the example usages that you listed.
I realize that I did not make my original intention clear enough.
Here is what I want to do in factor:
(1) invoke custom command in shell: cmd1 -a A -b B
>
> Ultimately, I may also insert some factor quot in betweeen
> str1 and str2 to do some processing before handing the
> result to cmd2.
Do you mean you want to take the output of running cmd1, manipulate it,
then pass *that* to cmd2? Because that sounds rather different from what
your example
You might also consider implementing the >process method for your custom
/ objects, which will be called automatically when invoking
run-pipeline.
http://docs.factorcode.org/content/word-__gt__process,io.launcher.html Or
just do away with / objects altogether and build those as
strings/arrays
I want to run binary codes (C++) under linux using run-pipeline
In linux shell, the task is
cmd1 -a arg1 -b arg2 | cmd2 -c arg3
I know in general, in factor, I need to construct
{ str1 str2 } run-pipeline
where str1 = “cmd1 -a arg1 -b arg2”
str2 = “cmd2 -c arg3”
Ultimately, I may