Skip to content

Instantly share code, notes, and snippets.

@rojenzaman
Created April 14, 2021 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rojenzaman/8bcc89b568ca810562fd2929ea9e261c to your computer and use it in GitHub Desktop.
Save rojenzaman/8bcc89b568ca810562fd2929ea9e261c to your computer and use it in GitHub Desktop.
Replace specified character between two specified strings.
# s@\(START.*\)FOO\(.*END\)@\1BAR\2@
$ echo "START FOO END FOO" | sed -e :1 -e 's@\(START.*\)FOO\(.*END\)@\1BAR\2@;t1;'
START BAR END FOO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment