Hallo! Vielen Dank für das Skript, leider bekomme ich es nicht so recht zum Laufen. Am Montag, 4. April 2005 23:08 schrieb Uli Wachowitz:
for i in $IFACES; do [ "$WLANIFACE == "" ] && \ ifconfig $i 2>/dev/null | \ grep -q $WLANMAC && WLANIFACE="$i" done
Mein Problem ist, dass ich das ganze zwischen do und done nicht verstehe. Ich kenne PHP und ein wenig C++, wohl zu wenig. Könnte mir jemand bitte die einzelnen Abschnitte erklären? Ich habe keine bash Seite gefunden, die mir die Fragen beantworten konnte. [ "$WLANIFACE == "" ] && \ Ist das die Bedingung für die Schleife? ifconfig $i 2>/dev/null | \ ifconfig mit $i wird ausgeführt und der Inhalt wird nach /dev/null geschrieben, bei >2 weiß ich nicht was die 2 bedeutet. grep -q $WLANMAC ist klar. WLANIFACE="$i" Eigentlich auch klar, aber wird es nicht bei jeder Schleife mit $i einfach überschrieben, oder bricht die Schleife vorher ab? Die && kenne ich nur als AND. Ich habe hinter die Schleife mal logger "WLANIFACE $WLANIFACE" gesetzt, was aber immer eine leere Variable ausgibt. Wenn ich die Antworten doch im Internet finden kann, wäre ich für einen entsprechenden Querverweis dankbar. Sven