daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Nov 21st, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. directory=$1
  4.  
  5. dest=/Volumes/Andre_800G/Serien/ready/
  6. destBin="done"
  7.  
  8. cd $directory
  9. if [ ! -d "$destBin" ]; then
  10.     echo "Creating folder $destBin..."
  11.     mkdir $destBin
  12. fi
  13.  
  14. shopt -s nullglob
  15. for f in *.mkv
  16. do
  17.     echo "Processing file $f..."
  18.     trackID=$(mkvmerge -I "$f" | sed -En 's/Track ID ([0-9]*): audio.*language:eng.*/\1/p')
  19.     mkvmerge -o "$dest/$f" -a $trackID "$f"
  20.     echo "Move the file to the \'$done\' folder."
  21.     mv "$f" $destBin
  22.     echo ""
  23. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top