Created
September 10, 2018 02:14
-
-
Save gyakkun/f4a4f49a6df7983e28978cd311cb546c to your computer and use it in GitHub Desktop.
Rename some torrent files in my convention.
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 | |
for i in $(ls *.torrent); do | |
new_filename=`transmission-show $i | grep -Po "(?<=^Name: ).+$"` | |
rename -v "s/(?<=\[U2\]\.)(?=(\d+))/$new_filename\./" $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment