How do I populate array from an string output of a bash string.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marek Dohojda
    New Member
    • Mar 2011
    • 1

    How do I populate array from an string output of a bash string.

    I need to split an output from a bash script and populate an array with it. So I can manipulate and print that later. Unfortunately I can not find a way to do that.
    so what I have thus far is this:
    os.system("scri pt.sh")
    this gives me multi line output such as:
    server machine name status
    I want to put this into an array so I can print it later (although dictionary would be even nicer with custom fields).
    Basically i want to later on display this output in fields within a web page table.

    Thank you!
Working...