Skip to content

Instantly share code, notes, and snippets.

@danielcosta
Last active August 29, 2015 14:01
Show Gist options
  • Save danielcosta/d43efdac1dd08faf08f1 to your computer and use it in GitHub Desktop.
Save danielcosta/d43efdac1dd08faf08f1 to your computer and use it in GitHub Desktop.
Replace "from" with "to" keeping backup of original files
for i in *; do cat $i | sed s/from/to/g > $i.out; mv $i $i.bkp; mv $i.out $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment