linux - Can't rename a file name -


i have small bash script download , rename files. problem gibberish not standard characters bash can't understand.

for example:

�������� ���� ���'�-2.jpg 

my bash

while read line;  if [ ! -z "$line" ];   new_filename=$(echo "$line" | uniconv -encode russian-translit |  uniconv -encode latin | tr -d '\[\]\!\@\#\$\%\^\&\*\(\)\?\'')   mv "$line" "$new_filename"  fi done <<< "$files_to_convert" 

why don't delete characters :
sed 's/[^a-za-z0-9_\.-]//g'


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -