Skip to content

Instantly share code, notes, and snippets.

@sranso
Last active August 29, 2015 14:08
Show Gist options
  • Save sranso/1db567b683f91e3f0194 to your computer and use it in GitHub Desktop.
Save sranso/1db567b683f91e3f0194 to your computer and use it in GitHub Desktop.

replace all captured strings in a repo with this arg

ls apps/webviews/public/stylesheets/*.less | xargs perl -pi -e 's/imagePath/differentNewPath/'
ls apps/webviews/public/stylesheets/*.less | xargs perl -pi -e 's/\@\{(.*)\}/\@\{hello_$1\}/'
  • -p run file in loop
  • -i modifies file in place. takes optional argument (e.g. create backup file to everything)
  • -e expresion you want to run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment