Skip to content

Instantly share code, notes, and snippets.

@lzjluzijie
Created December 20, 2018 06:37
Show Gist options
  • Save lzjluzijie/50a2bf8fc11d1a47c3ab3bc2a07e2939 to your computer and use it in GitHub Desktop.
Save lzjluzijie/50a2bf8fc11d1a47c3ab3bc2a07e2939 to your computer and use it in GitHub Desktop.
youku-rename
cd files
for file in `ls`
do
if [ ${#file} == "73" ]; then
new=${file:0:71}00.ts
fi
if [ ${#file} == "75" ]; then
new=${file:0:71}0${file:71:4}
fi
if [ ${#file} == "76" ]; then
new=$file
fi
echo $new
mv $file $new
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment