From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2321 invoked from network); 14 Jun 2004 03:37:49 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 14 Jun 2004 03:37:49 -0000 Received: (qmail 24531 invoked from network); 14 Jun 2004 03:37:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Jun 2004 03:37:35 -0000 Received: (qmail 29906 invoked by alias); 14 Jun 2004 03:37:14 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7535 Received: (qmail 29896 invoked from network); 14 Jun 2004 03:37:14 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 14 Jun 2004 03:37:11 -0000 Received: (qmail 23757 invoked from network); 14 Jun 2004 03:37:11 -0000 Received: from redfish.gatech.edu (HELO cyberbuzz.gatech.edu) (130.207.165.230) by a.mx.sunsite.dk with SMTP; 14 Jun 2004 03:37:09 -0000 Received: by cyberbuzz.gatech.edu (Postfix, from userid 20135) id 3670A79492; Sun, 13 Jun 2004 23:37:08 -0400 (EDT) Date: Sun, 13 Jun 2004 23:37:08 -0400 From: Jason Price To: William Scott , zsh-users@sunsite.dk Subject: Re: how do I find my IP address Message-ID: <20040613233708.A28043@redfish.gatech.edu> References: <67BDB808-BDA2-11D8-9044-000A957D73C4@chemistry.ucsc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <67BDB808-BDA2-11D8-9044-000A957D73C4@chemistry.ucsc.edu>; from wgscott@chemistry.ucsc.edu on Sun, Jun 13, 2004 at 06:30:23PM -0700 X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 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). The 'grep inet' should give you all the ip addresses, but will also have things like netmask. The 'grep -v 127.0.0.1' will cut out the localhost definition. The 'awk '{print $2}' should give you just the IP address, but it might be in a different field (try 3, 4, etc). I'm sure there's a way to figure out a pure zsh way to do this, but I don't know it. Also, I strongly suggest figuring this out once, stashing it in a variable ($MY_IP or some such), and just using that variable. If you're under windows, under cygwin, you're on your own, but I'd start with 'ipconfig /all'. --Jason On Sun, Jun 13, 2004 at 06:30:23PM -0700, William Scott wrote: > Timothy: > > If you are running a computer with an ip address that changes > (dynamically allocated), this will work, although it is kind of ugly: > > define an alias such as: > > alias myip="curl -s http://www.showmyip.com/simple/ | awk '{print $1}' > " > > > > I would echo the output of myip into something at login rather than > grab it off the internet every time I hit the return key. > > > If you have a static ip address, you should only have to figure this > out once. On Mac OS X you can find this in the System Preferences > under file sharing or network settings (I am assuming this on the basis > of the Micro$oft email stamp at the bottom of your email.) > > This alias and a whole bunch of stuff that is useful for OS X zsh is > distributed by Gary Kerbaugh. I have links to it and a few of my own > zsh functions here: http://tinyurl.com/3373b > > Bill Scott > > > http://www.apple.com/trailers/lions_gate/fahrenheit_911/ > >