Skip to content

Instantly share code, notes, and snippets.

@franssu
Last active February 10, 2016 15:17
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 franssu/acf8a27ef9917553814d to your computer and use it in GitHub Desktop.
Save franssu/acf8a27ef9917553814d to your computer and use it in GitHub Desktop.
foo ()
{
dirs=`find . -type d -name "*$1*"`
files=`find . -type f -name "*$1*"`
echo "Dirs:"
echo ${dirs}
echo "Files:"
echo ${files}
echo ${dirs} | while read -r dir; do cp -R "$dir" "${dir//$1/$2}"; done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment