Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Mar 2007 07:27:56 -0600
From:      Derek Ragona <derek@computinginnovations.com>
To:        Gary Kline <kline@tao.thought.org>, FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: awk question
Message-ID:  <6.0.0.22.2.20070306072709.02577448@mail.computinginnovations.com>
In-Reply-To: <20070306003506.GA12553@thought.org>

index | next in thread | previous in thread | raw e-mail

You can loop through them using a shell script:
for i in `ls -lt | awk '{if ($8 == 2006) print $9}'`;do rm $i;done

         -Derek


At 06:35 PM 3/5/2007, Gary Kline wrote:

>         Guys,
>
>         Having found $9 , how do I /bin/rm it (using system()--yes??)
>         in an awk one-liner?
>
>         I'm trying to remove from packages from long ago and find and
>         print them with
>
>         ls -lt | awk '{if ($8 == 2006) print $9}';
>
>         but what I want to remove the file pointed at by $9.  I've tried
>         FILE=ARGV[9]; and using FILE within my system() call, but no-joy.
>         What's the magic here?
>
>         thanks in advance,
>
>         gary
>
>
>
>--
>   Gary Kline  kline@thought.org   www.thought.org  Public Service Unix
>
>_______________________________________________
>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"
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>MailScanner thanks transtec Computers for their support.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.0.0.22.2.20070306072709.02577448>