Mailinglist Archive: opensuse (1503 mails)

< Previous Next >
Re: [opensuse] Boot Script
Hi David


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:[ ]*\([^ ]*\) .*$,\1,p'`

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.

Yes, the output is 100% same.



To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >