Scripting Problem

Ed Wilts ewilts at ewilts.org
Thu Apr 29 03:09:14 UTC 2004


On Wed, Apr 28, 2004 at 06:51:08PM -0700, redhat at chamkila.org wrote:
> I have a file that contains a bunch of the following entries:
> 
> trusty.F.0038 02/11/02
> trusty.F.0058 04/11/04
> trusty.F.0063 05/12/02
> trusty.F.0064 05/13/02
> trusty.F.0178 04/21/04
> trusty.F.0183 09/30/02
> trusty.F.0276 04/04/04
> .....
> 
> I would like to take out entries that match 04/xx/04 (xx does not matter)
> and dump them to a different file.  In this case 58, 178 and 276.  I am
> unable to do this with awk.  Anyone know of a way I can do this using
> csh??

It's easily done with egrep.

[ewilts at pe400 ewilts]$ egrep '.*04/../04' foo
trusty.F.0058 04/11/04
trusty.F.0178 04/21/04
trusty.F.0276 04/04/04

-- 
Ed Wilts, Mounds View, MN, USA
mailto:ewilts at ewilts.org
Member #1, Red Hat Community Ambassador Program





More information about the redhat-list mailing list