Skip to content

Instantly share code, notes, and snippets.

@seamountain
Last active December 14, 2015 15:08
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 seamountain/5105281 to your computer and use it in GitHub Desktop.
Save seamountain/5105281 to your computer and use it in GitHub Desktop.
Script of sed all files on Mac OSX.
files_path=path/to/directory
cd $files_path && find . -name "*.feature" | xargs sed -i '' "s/[0-9]*_//g"
@seamountain
Copy link
Author

The script can replace, but saved file name is wrong. I want to just replace the files.
gsed is not work too...

We cannot use "+" as regex.
http://www.tutorialspoint.com/unix/unix-regular-expressions.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment