From owner-freebsd-questions@FreeBSD.ORG Thu Feb 24 02:36:06 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A79316A4CE for ; Thu, 24 Feb 2005 02:36:06 +0000 (GMT) Received: from teancum.pp.asu.edu (teancum.pp.asu.edu [129.219.69.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0FA3143D58 for ; Thu, 24 Feb 2005 02:36:06 +0000 (GMT) (envelope-from iddwb@teancum.pp.asu.edu) Received: from teancum.pp.asu.edu (localhost.localdomain [127.0.0.1]) by teancum.pp.asu.edu (8.12.11/8.12.11) with ESMTP id j1O2a52V031303; Wed, 23 Feb 2005 19:36:05 -0700 Received: (from iddwb@localhost) by teancum.pp.asu.edu (8.12.11/8.12.11/Submit) id j1O2a5mT031301; Wed, 23 Feb 2005 19:36:05 -0700 Date: Wed, 23 Feb 2005 19:36:05 -0700 From: David Bear To: Roland Smith Message-ID: <20050224023605.GD31005@asu.edu> References: <20050223214010.GA31005@asu.edu> <20050223221926.GB69249@slackbox.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050223221926.GB69249@slackbox.xs4all.nl> User-Agent: Mutt/1.4.1i cc: freebsd-questions@freebsd.org Subject: Re: awk print X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: David.Bear@asu.edu List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Feb 2005 02:36:06 -0000 On Wed, Feb 23, 2005 at 11:19:26PM +0100, Roland Smith wrote: > On Wed, Feb 23, 2005 at 02:40:10PM -0700, David Bear wrote: > > I'm using awk to parse a directory listing. I was hoping there is a > > way to tell awk to print from $2 - to the end of the columns > > available. > > > > find ./ -name '*stuff' | awk '{FS="/" print $3---'} > > Is this what you mean?: > > find ./ -name '*stuff'|sed 's|\.[^/]*/[^/]*/||g' thanks for the advice. No, this doesn't do what I want. If I have a directory path /stuff/stuff/more/stuff/more/and/more that is n-levels deep, I want to be able to cut off the first two levels and print the from 2 to the Nth level. > > Roland > -- > R.F. Smith /"\ ASCII Ribbon Campaign > r s m i t h @ x s 4 a l l . n l \ / No HTML/RTF in e-mail > http://www.xs4all.nl/~rsmith/ X No Word docs in e-mail > public key: http://www.keyserver.net / \ Respect for open standards -- David Bear phone: 480-965-8257 fax: 480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 "Beware the IP portfolio, everyone will be suspect of trespassing"