Skip to content

Instantly share code, notes, and snippets.

@ipleten
Created March 26, 2020 23:28
Show Gist options
  • Save ipleten/98b7342cba2243d1436ea4c4cc18a12e to your computer and use it in GitHub Desktop.
Save ipleten/98b7342cba2243d1436ea4c4cc18a12e to your computer and use it in GitHub Desktop.
Replace clean: section in Makefile assuming sections are separated by empty line. Sed multi-line replacement.
# using range bounderies and 'c' command;
sed -e ' /clean:/, /^ *$/ c clean:\n\tREPLACED' Makefile
section:
ls
clean:
rm -rf ./tagget
something-else:
kill-all-human.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment