Skip to content

Instantly share code, notes, and snippets.

@mkrogemann
Created September 6, 2018 14:30
Show Gist options
  • Select an option

  • Save mkrogemann/a649357ba7089c4b01d88bcde67fedd5 to your computer and use it in GitHub Desktop.

Select an option

Save mkrogemann/a649357ba7089c4b01d88bcde67fedd5 to your computer and use it in GitHub Desktop.

Revisions

  1. mkrogemann created this gist Sep 6, 2018.
    6 changes: 6 additions & 0 deletions pattern-remover.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/bash

    for thefile in `find <path to start from> -type f -name <filename pattern>` ; do
    grep -v "<text to be removed (affects whole line)>" $thefile > $thefile.$$.tmp
    mv $thefile.$$.tmp $thefile
    done