Sometimes, we have a large collection of files e.g mp3 files that plays fine in a computer, but fails to copy to an external devices like a mobile phone, because of weird file naming. One of such cases happened to me, where all the files in a directory had pipe character (|) on them.
Those files would play fine on a computer, but failed to copy to a phone. Therefor,e I had to create following script to rename all those files, just by removing the pipe character(|). Here is the script (rename.sh).
for file in *.mp3
do
rename 's/\|//' "$file"
done
I hope it helps someone.