Created
April 8, 2018 17:17
-
-
Save RomaniukVadim/b19b35729eb4917cb6b417a4802f00d0 to your computer and use it in GitHub Desktop.
Revisions
-
RomaniukVadim created this gist
Apr 8, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ #!/bin/sh IFS=' ' for file in *.mp3; do if [ ! -d "$file" ]; then newfilename=`echo "$file" | sed -e "s/ /_/g"`; new_name=`echo $newfilename |awk '{print substr($0,1,length-16)}'| xargs -I{} echo "{}.mp3"`; mv "$file" "$new_name" 2>/dev/null; fi done