Skip to content

Instantly share code, notes, and snippets.

@michiel
Created April 25, 2014 14:00
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 michiel/11290561 to your computer and use it in GitHub Desktop.
Save michiel/11290561 to your computer and use it in GitHub Desktop.
bash for loop replace with sed in filenames with spaces
#!/bin/bash
# bash for loop replace with sed in filenames with spaces
STORED_IFS=$IFS
IFS=$(echo -en "\n\b")
for file in `find . | grep "md$"`; do
sed -i 's/X/Y"/g' "$file"
done
IFS=$STORED_IFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment