MaD dUCK on Wed, 29 Nov 2000 15:56:00 -0500 (EST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] scanning a line


hi,
we all love grep and that's for a reason. however, sometimes i wish to
scan a single line for a pattern and only get the pattern back. simply
example:

the pattern "[0-9]*" should return the string in the second column
when applied to the string in the first column:

aaaa9879aaaaaa0870aaaaaaaaaaa09    =>  9879 0870 09
aa908798986986aaaaaaaaaaaaaaaaa    =>  908798986986

in the first case, it would be even better to sort of include some
'cut' features, such that i could say give me the 2nd occurrence of
the pattern, and it would only return 0870.

is this possible? i.e. is there a command to do this? or a simple
hack? this needs to be shell script...

thanks,
martin

[greetings from the heart of the sun]# echo madduck@!#:1:s@\@@@.net
-- 
oxymoron: microsoft works


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug