Last active
January 25, 2021 17:05
-
-
Save powerswitch/9692166 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/bash | |
# Finde alle Filmordner | |
MOVIES=$(find . | grep STREAM$) | |
# Für jeden Film: | |
for M in $MOVIES | |
do | |
# Liste alle Filmdateien auf | |
FILES=$(ls $M/*.m2ts) | |
# Extrahiere den Namen | |
NAME=$(echo $M | sed -r "s/[^\/]*\/([^\/]*)\/STREAM/\1/") | |
# mkvmerge-Kommando | |
COMMAND="yes no | mkvmerge " | |
for F in $FILES | |
do | |
# Datei anhängen | |
COMMAND=$COMMAND+$F" " | |
done | |
# Ausgabepfad setzen | |
COMMAND=$COMMAND" -o "$M"/../"$NAME".mkv" | |
# Eigentlich ausführen, aber hier nur Trockenübung | |
echo $COMMAND | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment