Last active
January 30, 2019 18:27
-
-
Save flaviosilveira/09d996a733bd152a952373f15fbf184d to your computer and use it in GitHub Desktop.
Shell script to remove a specific line from files in a directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for file in `grep -ril 'pattern-match' . | grep -v 'script'` | |
do | |
sed -i '/pattern-match/ d' $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment