var output =`ls`# `output` is a stringvar lines =`ls`.lines # `lines` is an array
Using pipes:
var pipe =%p(ls) # same as: Pipe('ls')var pipe_h = pipe.open_r # open the pipe for readingvar lines = [] # will store the lines of the outputpipe_h.each { |line| lines << line }