Roger,
those are good answers, but to go a step further and actually get the
command output into an array so you can manipulate it - here is an
example in unix:
(it sorts and formats the du output so i can see which subdirs are using
the most space)

parse arg directory .                  -- directory name can be passed as 
argument

If directory = ''  Then                -- no directory name passed?
   directory = '.'

"du" directory "| rxqueue"             -- pipe du stdout to rexx queue

duline = .array~new(queued())          -- set up du lines array
i = 1

Do queued() - 1                        -- queued() returns # of lines in 
external data queue
   Parse Pull size subdir .            -- get a line
   duline[i] = RIGHT(size,9,' ') subdir -- right-align size so sort works
   i += 1                              -- increment array index
end

duline~sort                            -- sort the array

Do item over duline                    -- send sorted array to stdout
   say item
End

exit

sample output:
...
       56 /home/prgramly/euler
       88 /home/prgramly/Expect-1.20/tutorial
      184 /home/prgramly/IO-Tty-1.07
      352 /home/prgramly/expect
      432 /home/prgramly/Expect-1.20
    13120 /home/prgramly/temp

it obvious that i have something(s) big in my temp/ 


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to