Instantly share code, notes, and snippets.

Embed
What would you like to do?
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