RosettaCodeData/Task/Get-system-command-output/Sidef/get-system-command-output-2.sidef

5 lines
214 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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 }