Skip to content

Instantly share code, notes, and snippets.

@gioxx
Created November 11, 2018 18:27
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 gioxx/541287811537bb33f32a8c251a2267f2 to your computer and use it in GitHub Desktop.
Save gioxx/541287811537bb33f32a8c251a2267f2 to your computer and use it in GitHub Desktop.
Uno script bash che permette di organizzare un gruppo di video in cartelle che ne contengono al massimo 50 cadauna. Vedi post sul blog: https://wp.me/pdQ5q-9UO
#!/bin/bash
# Blocco rename da MP4 a mp4
for i in *.MP4;
do mv $i ${i%%.MP4}.mp4;
done
# Riorganizzo i video in cartelle in blocchi da 50 ($c -eq 50)
c=1; d=1; mkdir -p VID_${d}
for vid_file in *.mp4
do
if [ $c -eq 50 ]
then
d=$(( d + 1 )); c=0; mkdir -p VID_${d}
fi
mv "$vid_file" VID_${d}/
c=$(( c + 1 ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment