Use a function like this one to execute a host command and get the result into a variable. ps: still debugging this one.
∇Execute[⎕]∇ ∇ [0] z←Execute cmd;⎕io;fh [1] ⎕io←0 [2] fh ← ⎕FIO[24] cmd [3] z←⎕av[⎕fio [8] fh] [4] Loop: →(0≠⎕FIO[10] fh)/Fini [5] z←z,⎕av[⎕fio [8] fh] [6] →Loop [7] Fini: ⎕FIO[25] fh [8] ⊃⊃z ∇ On 2016-03-04 21:54, alexwei...@alexweiner.com wrote:
Hi Bug-apl, Currently, at a point in my code I do something like this: ⍝assume the variable 'yadda' exists and is correctly formed, as well as the read_file function success←yadda ⎕fio[7] tie← 'wr'⎕FIO[3] "yadda.file" )host ./shellscript.sh <http://shellscript.sh> yadda.file yadda.file.new yadda_new← read_file "yadda.file.new" ⍝end of code My question is: is there either 1. a way to feed )host a variable (I don't think that is possible) or 2. a better way to implement this task in its entirety. I find it a small nuisance that I have to write and then read a file in my code to access non-APL stuff for processing. -Alex