From: btna on
Hi all,

I have a file that looks like:


*/tmp/dst/file1*234*RW*6790
*/tmp/dst/file2*568*RW*908
*/tmp/dst/file3*345*RW*746
*/test/flm/file4*354*RW*987
*/test/flm/file5*643*RW*645


I need to keep all of the lines with the exception of the one with
file1 and file3 which have in common "/tmp/dst". I need to preserve
the line /tmp/dst/file2 plus the others that start with */test


Any ideas on how to do this with korn shell?

Thanks!
BTNA
From: Michael Tosch on
btna wrote:
> Hi all,
>
> I have a file that looks like:
>
>
> */tmp/dst/file1*234*RW*6790
> */tmp/dst/file2*568*RW*908
> */tmp/dst/file3*345*RW*746
> */test/flm/file4*354*RW*987
> */test/flm/file5*643*RW*645
>
>
> I need to keep all of the lines with the exception of the one with
> file1 and file3 which have in common "/tmp/dst". I need to preserve
> the line /tmp/dst/file2 plus the others that start with */test
>
>
> Any ideas on how to do this with korn shell?
>
> Thanks!
> BTNA


grep -v '/tmp/dst/file[13]' file


--
Michael Tosch @ hp : com
From: Chris Mattern on
On 2008-04-15, btna <btna(a)terra.com> wrote:
> Hi all,
>
> I have a file that looks like:
>
>
> */tmp/dst/file1*234*RW*6790
> */tmp/dst/file2*568*RW*908
> */tmp/dst/file3*345*RW*746
> */test/flm/file4*354*RW*987
> */test/flm/file5*643*RW*645
>
>
> I need to keep all of the lines with the exception of the one with
> file1 and file3 which have in common "/tmp/dst". I need to preserve
> the line /tmp/dst/file2 plus the others that start with */test
>
>
> Any ideas on how to do this with korn shell?
>
grep -v /tmp/dst/file1 input-file | grep -v /tmp/dst/file3

--
Christopher Mattern

NOTICE
Thank you for noticing this new notice
Your noticing it has been noted
And will be reported to the authorities