Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Extracting string from a file - shell script


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