Hallo,
On 2005.01.20 11:50, Thilo Engelbracht wrote:
grep is your friend. :-)while [ -z "$quota" ] do read zeile account=`echo $zeile | cut -d : -f 2 | cut -d " " -f 2-` done
Der Code ist vielleicht etwas umständlich - aber es funktioniert
problemlos. Nun möchte ich jedoch noch erreichen, dass ich in der
Text-
datei auch Leerzeilen und Kommentare einfügen kann, beispielsweise so:
do
read zeile
if [ `echo "$zeile" | grep -v "^\w*$" | grep -v "^\w*#" ]; then
account=`echo $zeile | cut -d : -f 2 | cut -d " " -f 2`
fi
done
Ist jetzt nur ungetestet auf die Schnelle hingeworfen; kann also sein, dass die Syntax nicht ganz korrekt ist. Waere bestimmt auch sinnvoll, das in eine Funktion auszulagern, weil Du ja so viele Sachen einlesen willst.
Schoenen Gruss, Andreas
pgpQ9ba3oHHoo.pgp
Description: PGP signature