fileformatmv (407B)
1 #!/bin/rc 2 # 3 # tag/fileformat, but renames them 4 # 5 6 for (old in $*) { 7 if (echo $old | grep -vEi '\.(mp3|flac|opus|m4a)$' >/dev/null) { 8 printf 'NOT AUDIO:\t%s\n' $old >[1=2] 9 continue 10 } 11 12 new = `$nl{tag/fileformat $old} 13 14 if (echo $new | grep '/[0-9][0-9] ..*\..*$' >/dev/null && echo $new | grep -v '/00' >/dev/null) { 15 mv -v $old $new 16 } else { 17 printf 'CHECK FAILED:\t%s\t%s\n' $old $new >[1=2] 18 } 19 }