Mailinglist Archive: opensuse (1683 mails)

< Previous Next >
Re: [SLE] IP adress
  • From: dregiste@xxxxxxxxxxxxx (Damon Register)
  • Date: Tue, 21 Nov 2000 20:42:59 -0500
  • Message-id: <3A1B24A3.93437A4@xxxxxxxxxxxxx>

Message-ID: <3A1B24A3.93437A4@xxxxxxxxxxxxx>
Date: Tue, 21 Nov 2000 20:42:59 -0500
From: Damon Register <dregiste@xxxxxxxxxxxxx>
Subject: Re: [SLE] IP adress



Jesse Marlin wrote:
> 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

< Previous Next >
Follow Ups
References