From: Jussi Pakkanen <jpakkane@yahoo.com>
To: zsh-users@sunsite.dk
Subject: Re: how do I find my IP address
Date: Mon, 14 Jun 2004 03:58:20 -0700 (PDT) [thread overview]
Message-ID: <20040614105820.62157.qmail@web40303.mail.yahoo.com> (raw)
In-Reply-To: <20040613233708.A28043@redfish.gatech.edu>
--- Jason Price <jprice@cyberbuzz.gatech.edu> wrote:
> On most unix flavors, some varient of:
>
> ifconfig -a | grep inet | grep -v '127.0.0.1' | awk
> '{print $2}'
>
> should work. 'ifconfig' can live in various places,
> but usually it
> is in /sbin/ifconfig or /usr/sbin/ifconfig (old
> unixen might have it in /etc/ifconfig).
> I'm sure there's a way to figure out a pure zsh way
> to do this, but I don't know it.
The purest I could think of was eliminating awk, which
can be done like this:
foo=`ifconfig | grep inet | grep -v '127.0.0.1'`
baz=($=foo)
Now $baz[2] contains the ip address. I guess you could
get the address by poking /proc, but that's not very portable.
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
next prev parent reply other threads:[~2004-06-14 10:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-14 1:30 William Scott
2004-06-14 3:37 ` Jason Price
2004-06-14 10:58 ` Jussi Pakkanen [this message]
2004-06-14 11:57 ` Vincent Lefevre
2004-06-14 12:23 ` James Devenish
2004-06-14 13:18 ` Vincent Lefevre
2004-06-14 3:57 ` Timothy Luoma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040614105820.62157.qmail@web40303.mail.yahoo.com \
--to=jpakkane@yahoo.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).