I've extracted songs from my ipod, but when doing so, every song was renamed "- [original name of the song]" . I wanted to write a bash script that would remove that first "-" because there are maybe a 1000 songs in there and I can't rename each of them manually. I've tried to do it using mv and rename but it won't work because of the special characters. I've looked it up on the internet and I found a solution that consists in replacing "-" with "" but the problem is that I want to remove only the first "-" and not the potential others that can be in my song's name. I hope I was clear enough and that someone can help me?
Here is my original script :
#!/bin/bash
for f in *; do
echo "${f}";
if [[ ${f:0:1} == "-" ]]; then
echo "renaming ${f}";
rename.ul ${f} ${f:1} *.mp3;
fi
done