RosettaCodeData/Task/Get-system-command-output/Sidef/get-system-command-output-2.sidef
2023-07-01 13:44:08 -04:00

4 lines
214 B
Text

var pipe = %p(ls) # same as: Pipe('ls')
var pipe_h = pipe.open_r # open the pipe for reading
var lines = [] # will store the lines of the output
pipe_h.each { |line| lines << line }