Skip to content

Instantly share code, notes, and snippets.

@Cellane
Created December 10, 2010 21:10
Show Gist options
  • Save Cellane/736825 to your computer and use it in GitHub Desktop.
Save Cellane/736825 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo -n "Zdrojový adresář: "
read zdroj
echo -n "Cílová cesta: "
read cil
echo -n "Přípona: "
read pripona
if [ -d $zdroj ]; then
if [ ! -d $cil ]; then
mkdir $cil
fi
find $zdroj -type d -exec mkdir $cil/'{}' ';' 2>/dev/null
find $zdroj -type f -regex ".*$pripona" -exec cp '{}' $cil/'{}' ';' 2>/dev/null
else
echo "Adresář neexistuje!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment