Skip to content

Instantly share code, notes, and snippets.

@felix-orduz
Created August 1, 2016 21:06
Show Gist options
  • Select an option

  • Save felix-orduz/30b570de16ae26b8d50417d04c95823b to your computer and use it in GitHub Desktop.

Select an option

Save felix-orduz/30b570de16ae26b8d50417d04c95823b to your computer and use it in GitHub Desktop.
#!/bin/bash
for d in */; do
echo "Procesar" $d;
cd $d
cantidad=$(find ./ -type f -name "*.mkv" | wc -l)
let cantidad=$cantidad
if [ "$cantidad" -gt 0 ]; then
mkdir tmp
mv *.mkv tmp
rm *
mv tmp/* ./
rm -rf tmp
fi
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment