Created
November 11, 2018 18:27
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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