22 Nov
2000
22 Nov
'00
01:42
Message-ID: <3A1B24A3.93437A4@bellsouth.net>
Date: Tue, 21 Nov 2000 20:42:59 -0500
From: Damon Register
filip1 writes:
Hi all,
Does anyone know a command or a little script giving you only the ip adress of your card ?
#!/bin/bash extif="eth0" extip=$($ifconfig ${extif} | sed -ne '/addr:/{s/.*addr:\([^ ]*\).*/\1/;p;}') echo $ip
looks like there are quite a few ways to do this. Here is one that works for me: extip="`/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`" Damon Register