WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   Shellscript Problem Spaltenausgeba in Zeilenausgabe umwandeln (http://www.wcm.at/forum/showthread.php?t=212808)

adler 26.03.2007 16:58

Shellscript Problem Spaltenausgeba in Zeilenausgabe umwandeln
 
hallo leute,

ich möchte die Ausgabe des fongenden Befehls:

cat /proc/mdstat | grep md | cut -d' ' -f1

AUSGABE:
md1
md2
md0

in eine Zeileausgabe umleiten

md1 md2 md0

Hat jemand eine Idee wie ich das in den Befehl packen kann bzw. weiterpipen ...

DANKE für jeden hinweis.

gruss
adler

adler 26.03.2007 18:00

Lösung
 
alles in eine variabel schreiben

variable=`cat /proc/mdstat | grep md | cut -d ' ' -f1`
ausgabe:
echo $variable
md1 md2 md0


Alle Zeitangaben in WEZ +2. Es ist jetzt 06:49 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag