script help
Tom H
tomh0665 at gmail.com
Wed Aug 25 15:48:16 UTC 2010
On Tue, Aug 24, 2010 at 8:01 AM, R Kimber <richardkimber at btinternet.com> wrote:
> On Mon, 23 Aug 2010 10:24:54 -0400
> Tom H wrote:
>
>> Good answer except for the unnecessary "cat".
>>
>> $ egrep "Antivirus Pattern" testfile | cut -d " " -f 5 | cut -c 2- | tr -d '.'
>
> But doesn't this assume that the string is on a line on its own with no
> leading or trailing spaces? Or do we know this?
I just looked at this quickly, saw the cat, assumed that there is
nothing in the file but "Antivirus ...", and wrote my post.
It will fail if the file's content is, for example:
tom Antivirus Pattern - Win vx.yyy.z
Whereas Cameron Hutchinson's solution will extract the correct data.
More information about the ubuntu-users
mailing list