From owner-freebsd-questions@FreeBSD.ORG Thu Feb 24 11:39:11 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 06B8916A4CF for ; Thu, 24 Feb 2005 11:39:11 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D7A143D1D for ; Thu, 24 Feb 2005 11:39:10 +0000 (GMT) (envelope-from soheil.h.y@gmail.com) Received: by rproxy.gmail.com with SMTP id 1so271918rny for ; Thu, 24 Feb 2005 03:39:10 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=etaQUTCJrH0XvcLkfLrwEmeo9vGOl5uW7sFkmTXfcIyGOv0XrV+/lA7QB3/0Q37uPnejRgeP34ejoJh6sY85hrZrT2ur8AqSPLmIK5TedaqeQtqfeEQOzFL6ftCNy2VwmSmxMm2RjZycNVpnARmuXfCJv6cjqjCSVqnwznBA9yE= Received: by 10.38.8.20 with SMTP id 20mr662116rnh; Thu, 24 Feb 2005 03:39:09 -0800 (PST) Received: by 10.38.179.59 with HTTP; Thu, 24 Feb 2005 03:39:09 -0800 (PST) Message-ID: <4c90b772050224033921bd036b@mail.gmail.com> Date: Thu, 24 Feb 2005 03:39:09 -0800 From: Soheil Hassas Yeganeh To: David Bear , freebsd-questions@freebsd.org In-Reply-To: <20050224034132.GE3123@guinness.local.mark-and-erika.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050223214010.GA31005@asu.edu> <20050223221926.GB69249@slackbox.xs4all.nl> <20050224023605.GD31005@asu.edu> <20050224034132.GE3123@guinness.local.mark-and-erika.com> Subject: Re: awk print X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Soheil Hassas Yeganeh List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Feb 2005 11:39:11 -0000 You can set $[1..n] to "" and then print find ./ -name "stuff" | awk '{ $1=""; $2=""; print} On Wed, 23 Feb 2005 22:41:32 -0500, Mark Frank wrote: > * On Wed, Feb 23, 2005 at 07:36:05PM -0700 David Bear wrote: > > 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. > > So how about cut? > > find ./ -name '*stuff'| cut -d/ -f4- > > Mark > > -- > "The fix is only temporary...unless it works." - Red Green > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >