Hallo in einem Shellskript rufe ich ein Programm auf, das mehrere Zeilen String auf den StdOut schreibt. Ich möchte den Output zeilenweise in ein Array speichern. Weiß jemand wie das geht? -- All parts should go together without forcing. ... By all means, do not use a hammer. (IBM maintenance manual, 1925)
IFS=$'\n' for i in $(ls -l); do echo $i; echo ---line done done IFS=$' \t\n'
Ich denke, den Rest schaffst du alleine. Für ne genaue Erklärung schau nach in 'man bash', IFS steht für Internal Field Separator. -- Einfachheit ist Voraussetzung für Zuverlässigkeit. -- Edsger Wybe DijkstraDieser Post wurde am 21.07.2003 um 15:50 Uhr von 0xdeadbeef editiert.
Danke, das ist ganau das was ich gesucht habe! -- All parts should go together without forcing. ... By all means, do not use a hammer. (IBM maintenance manual, 1925)