Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: egrep regular expression to remove a matching line  (Read 5321 times)

0 Members and 1 Guest are viewing this topic.

John_L.

    Topic Starter


    Rookie

    Thanked: 2
    • Experience: Experienced
    • OS: Windows XP
    egrep regular expression to remove a matching line
    « on: February 15, 2016, 06:59:04 PM »
    To my way of thinking,

    Code: [Select]
    egrep -x -e '(.*errorlog.txt.*){0}' dir.txt
    should remove a line containing "errorlog.txt" (anywhere in the line) from the input file. But it is not so. If fact, it matches ??? only the line containing "errorlog.txt".

    Can I utilize egrep to accomplish this task, and if so, what regular expression must I use?

    Thanks  in advance.