- To: slug <slug@xxxxxxxxxxx>
- Subject: Re: [SLUG] Extracting string from a file - shell script
- From: Phil Scarratt <fil@xxxxxxxxxxx>
- Date: Fri, 03 Jul 2009 10:42:00 +1000
- User-agent: Thunderbird 2.0.0.22 (X11/20090608)
Peter Chubb wrote:
>>>>>> "Phil" == Phil Scarratt <fil@xxxxxxxxxxx> writes:
> Phil> Something like this would work:
>
> Phil> cat <file> | perl -nle
> Phil> 'if(/^\*\*\*\s+End\s+of\s+([\S]+)\s+at\s+.*/){print $1;}'
>
>
> Why use cat?
>
> Why not <file perl ...
>
> The extra process plus pipe just wastes resources.
>
Good point! But then again sed is probably a better option anyway
Fil