From owner-freebsd-questions Sat Jan 6 23:27:44 2001 Delivered-To: freebsd-questions@freebsd.org Received: from comp1.mastery.ca (lan12.dzyn.win.mnsi.net [208.28.54.140]) by hub.freebsd.org (Postfix) with ESMTP id DAE6C37B6E7 for ; Sat, 6 Jan 2001 23:24:28 -0800 (PST) Received: from lan4 (rcmd01m04-35.bctel.ca [207.194.11.35]) (authenticated) by comp1.mastery.ca (8.11.1/8.11.1) with ESMTP id f077aqD51325; Sun, 7 Jan 2001 02:36:53 -0500 (EST) (envelope-from rmasse@max-info.net) Message-ID: <01fd01c0787a$f78b0400$0600a8c0@Home> From: "Ryan Masse" To: "Calvin" Cc: "FreeBSD-Questions" References: Subject: Re: Perl - IP Address Date: Sun, 7 Jan 2001 02:25:04 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG /sbin/ifconfig | perl -pe 's/\s+inet ([0-9\.]*).*/$1\n/sg || s/.*//sg' | mail -s 'output' user@domain this will mail the output of the ifconfig with the inet search to an specifies email addy or you can /sbin/ifconfig | perl -pe 's/\s+inet ([0-9\.]*).*/$1\n/sg || s/.*//sg' >> output this creates a seperate output file in which the contents of the search results From: "Calvin" To: "G D McKee" Cc: "freebsd-questions" Sent: Friday, January 05, 2001 7:35 PM Subject: Re: Perl - IP Address > They may not look pretty, but they work. > > To pull out the ip address, use ... > > \s+\w+\s+((?:\d+\S){3}\d+)(?:\s+\w+){3}\s+\S+ > > and to pull out the interface, use ... > > ^(\w+)\:\s+flags.*$ > > btw, this isn't really a FreeBSD question :-) > > > Hi > > > > Does any one have a regular expression that will pull out an IP Address from > > ifconfig. A regular network interface and a reg ex for tun0 for dial up? > > > > G D McKee > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-questions" in the body of the message > > > > _____________________________________________________________________ > Calvin M. Meloon Flying Crocodile, Inc > System Admin Seattle, WA > Writer of code, Manipulator of Data Office: 206-374-0374 > Security, Backups, & Recovery Cell: 206-255-8153 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message