Skip to content

Instantly share code, notes, and snippets.

@anikolaienko
Last active April 27, 2022 16:01
Show Gist options
  • Save anikolaienko/94b83f9493f3e2de0b59d0f9db996dec to your computer and use it in GitHub Desktop.
Save anikolaienko/94b83f9493f3e2de0b59d0f9db996dec to your computer and use it in GitHub Desktop.
Drop lines with certain text from file
if [ "$#" -ne 2 ]; then
echo "Illegal number of parameters"
return
fi
cat $1 | grep -v $2 > "$1_tmp" && mv "$1_tmp" $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment