nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

Variable nach Schleife nicht mehr sichtbar?

Von: Bernd Hohmann (bernd.hohmann.20090228@freihaendler.com) [Profil]
Datum: 05.11.2009 21:52
Message-ID: <7lgsfdF3ds1n4U1@mid.individual.net>
Newsgroup: de.comp.os.unix.shell
Ich werde alt... sowas funktionierte doch sonst so schön?

#!/bin/bash
tmp="hallo welt"
ps aux | grep "/dev/" | while read line; do
tmp="$tmp $line"
#  echo "tmp= $tmp"
done
echo "tmp= $tmp"

Ausgabe des Programms ist "tmp= Hallo Welt", wenn man den Kommentar
entfernt sieht man aber, dass die Variable "tmp" ordentlich gefüllt war
.

Hmpf?

Bernd

--
Visit http://www.nixwill.de and http://www.spammichvoll.de
jean.oliver@nixwill.de & bernado.bernhardi@spammichvoll.de

[ Auf dieses Posting antworten ]

Antworten