Mailinglist Archive: opensuse (1503 mails)

< Previous Next >
Re: [opensuse] Boot Script
  • From: David Haller <dnh@xxxxxxxxxxxx>
  • Date: Fri, 2 Oct 2009 02:17:19 +0200
  • Message-id: <20091002001719.GA13414@xxxxxxxxxxxxxxxxxx>

On Thu, 01 Oct 2009, Manfred Hollstein wrote:
Make sure, this is *one* line! So this should be:

EXT_IP=`/sbin/ifconfig eth0 | sed -n -e 's,.*inet addr:[ ]*\([^ ]*\)

For completeness (I hope the output format is still the same), and
with $() instead of ``:

export LANG=C
EXT_IP=$(/sbin/ip addr show eth0 |
sed -n 's/^ *inet \([0-9.]\+\) .*eth0$/\1/p')
INT_IP=$(/sbin/ip addr show eth1 |
sed -n 's/^ *inet \([0-9.]\+\) .*eth1$/\1/p')

(if you make one line, remove the '\' at the end of the first line)

The '.*eth0$' at the end of the expression is because interface-aliases
show up in the output.


Warning: Pregnancy can cause birth
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups