awk print
Mark Frank
mark at mark-and-erika.com
Thu Feb 24 03:41:38 GMT 2005
* 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
More information about the freebsd-questions
mailing list