Execute a system command: Difference between revisions

m
→‎{{header|Tcl}}: reword explanatory text
(Pari/GP)
m (→‎{{header|Tcl}}: reword explanatory text)
Line 746:
<lang tcl>set io [open "|ls" r]</lang>
 
would execute "ls" and pipe the result into the unitchannel whose name is put in the "io" variable. From there one could receive it either line by line like this:
 
<lang tcl>set nextline [gets $io]</lang>
Anonymous user