On Sun, 9 Mar 2003, Michael Collette wrote:

> It's ugly.  It won't work if you multiple NICs.  It may just work for what you
> need just the same.
> echo `ifconfig | grep broadcast | cut -d" " -f2`":0.0"
> This takes the output of ifconfig and parses it just a wee bit with grep and
> cut.  I use something very similar to this in a script that changes my
> network settings for my laptop on the fly.

All you need to do to deal with multiple NICs is specify which interface
you want to poll.  Awk can also combine the actions of both grep and cut
in the example into a single process:

echo `ifconfig xl0 | awk '/broadcast/ { print $2":0.0" }'`



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to