For some reason mv doesn’t work properly in my bash script.
This script should rename mp3 files with spaces
ls *mp3 > ls2.txt
while read line
do
sed_name=$(echo $line | sed 's/ /_/g' | sed "s/'//g")
mv "'"$line"'" "'"$sed_name"'";
done < ls2.txt
rm ls2.txt
but I’m getting the following error mv: target specified is not a directory (mv: указанная цель не является каталогом)
Instead of “‘”$line”‘”.. just try
mv “$line” “$sed_name”