Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Mar 2007 12:33:55 +0100
From:      "Christian Walther" <cptsalek@gmail.com>
To:        "bstitt@tsys.com" <bstitt@tsys.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Need a good Unix script that..
Message-ID:  <14989d6e0703140433t6fcdcccei9dc60b26bffc35bd@mail.gmail.com>
In-Reply-To: <OF41E635D9.5C37421A-ON8525729E.0035F7CA-8525729E.003C4080@tsys.com>
References:  <OF41E635D9.5C37421A-ON8525729E.0035F7CA-8525729E.003C4080@tsys.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14/03/07, bstitt@tsys.com <bstitt@tsys.com> wrote:
> Hello,
>
> I'm trying to write a script to delete all line that include a certain
> pattern in an output file. I sending information to one of our Security
> people and they take this data and create a spreadsheet on the
> information, I have a constant reoccurring lines within the output file
> that they do not need. I'm trying to use the sed command to remove lines
> that fits a certain pattern but it does not appear to remove anything.
>
> Any helpful ideas or any useful links to scripts.
>
You can use something like:

cat yourfile | grep -v pattern >newfile

If there are several patterns to be removed, use something like:

cat yourfile | egrep -v "(pattern1|pattern2|pattern3|...)" >newfile

HTH
Christian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14989d6e0703140433t6fcdcccei9dc60b26bffc35bd>