I'm having a little problem with renaming a bunch of files in a folder.
The script:
for file in $1
do
mv $file $file | sed -r 's/^.{20}//' | sed 's/.{16}$//'
done
The output:
mv: cannot move `/home/timothy/Videos/DB/' to a subdirectory of itself, `/home/timothy/Videos/DB/DB'
The SED command is correct, it's just that I'm doing something wrong with the mv parameters.
These are the names of the first 5 files:
[a-s]_dragon_ball_-_001_-_the_secret_of_the_dragon_balls__rs2_[4FC1375C]
[a-s]_dragon_ball_-_002_-_the_emperors_quest__rs2_[59F9C743]
[a-s]_dragon_ball_-_003_-_the_nimbus_cloud_of_roshi__rs2_[0C592F5F]
[a-s]_dragon_ball_-_004_-_oolong_the_terrible__rs2_[47CE4923]
[a-s]_dragon_ball_-_005_-_yamcha_the_desert_bandit__rs2_[B6A035BF]
And it should become this:
001_-_the_secret_of_the_dragon_balls
002_-_the_emperors_quest
003_-_the_nimbus_cloud_of_roshi
004_-_oolong_the_terrible
005_-_yamcha_the_desert_bandit