From owner-freebsd-questions Tue Feb 5 10:40:48 2002 Delivered-To: freebsd-questions@freebsd.org Received: from fremont.bolingbroke.com (adsl-216-102-90-210.dsl.snfc21.pacbell.net [216.102.90.210]) by hub.freebsd.org (Postfix) with ESMTP id B8C8637B41D for ; Tue, 5 Feb 2002 10:40:43 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by fremont.bolingbroke.com (8.12.1/8.12.1) with ESMTP id g15Ied6m072632; Tue, 5 Feb 2002 10:40:39 -0800 (PST) Date: Tue, 5 Feb 2002 10:40:39 -0800 (PST) From: Ken Bolingbroke X-X-Sender: ken@fremont.bolingbroke.com To: Angela Yu Cc: freebsd-questions@FreeBSD.ORG Subject: Re: [Unix shell script] In-Reply-To: Message-ID: <20020205103829.P91586-100000@fremont.bolingbroke.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 5 Feb 2002, Angela Yu wrote: > I am interested in knowing the shell script that can remove the subdomain > part of all FQDN in a input file, have domain name sorted and send the list > to a new output file. > > Example: > Input File - > www.hotmail.com > mail.yahoo.com > ftp.yahoo.com > mail.hotmail.com > www.computer.com.uk > > Output File- > computer.com.uk > hotmail.com > hotmail.com > yahoo.com > yahoo.com cut -d. -f2- < inputfile | sort > outputfile Ken Bolingbroke hacker@bolingbroke.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message