
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] pattern matching
- Date: Sat, 14 Feb 2004 01:29:52 +0900 (JST)
- From: Susumu ISHIZUKA <sufiyanjp@example.com>
- Subject: Re: [tlug] pattern matching
Hi,
--- roy lo wrote
>
> for awk
> Pattern="$1"; shift
> awk '{
> if ( match ($0, /'"$Pattern"'/) ) {
> print substr ($0, RSTART, RLENGTH)
> }
> }
> ' "$@"
--- "Stephen J. Turnbull" wrote:
> grep -e 'PATTERN' | sed -e 's/.*\(PATTERN\).*/\1/'
> perl -ane 'print "$&\n" if /PATTERN/'
you guys are really clever.
but my little grep(1) do it for me with,
$ grep -o PATTERN file
:-)
__________________________________________________
Do You Yahoo!?
http://bb.yahoo.co.jp/
Home |
Main Index |
Thread Index