Hi!
Wenn ich über ein Script, das mit dem Einwählen des Servers gestartet wird, die IP "abfrage"
ifconfig ppp0 | grep 'inet' | cut -d: -f2 | sed -e 's/[PzP-]/ /g'
bekomme ich nicht nur die IP, sondern auch andere Zeichen dazu z.B. 0200.110.245.144 t oder 200.110.245.144 t
Hat jemand eine Idee voran das liegen könnte.
Ifconfig
Re: Ifconfig
Möglicherweise ein Unterschied in der englischen und deutschen Ausgabe von ifconfig: "P-t-P:" für "Point to Point:" lässt ein "t" über, wenn Du statt dessen ein "P-z-P:" für "Punkt zu Punkt:" erwartest.
Meine Empfehlung:<blockquote><pre><font size="1" face="">code:</font><hr><font face="Courier New" size="2">
ifconfig ppp0 | awk -F'[ :]+' '/inet/ {print $4}'
</font><hr></pre></blockquote>
Jochen
Meine Empfehlung:<blockquote><pre><font size="1" face="">code:</font><hr><font face="Courier New" size="2">
ifconfig ppp0 | awk -F'[ :]+' '/inet/ {print $4}'
</font><hr></pre></blockquote>
Jochen
Re: Ifconfig
IPADDR=$(/sbin/ifconfig ppp0 | /bin/grep P-z-P | /usr/bin/cut -c 21-38 | /bin/awk '{print $1}' )
wenn du als user ein auswertung haben willst, dann P-z-P
wenn du als user ein auswertung haben willst, dann P-z-P
Last edited by gewitter on 18. May 2002 6:57, edited 2 times in total.