Skip to content

Instantly share code, notes, and snippets.

@izimbra
Created October 26, 2013 11:32
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 izimbra/7168403 to your computer and use it in GitHub Desktop.
Save izimbra/7168403 to your computer and use it in GitHub Desktop.
Globally replaces a quoted string (preceded with SOMETHING=) in a file1 using sed. The result is saved in file2. This was tried and worked in OS X 10.9. #sed #osx #shell
sed 's/SOMETHING="[^"]*"/SOMETHING="XXX"/g' file1 > file2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment