j'ai essayé de modifier ce script pour déplacer les anciens fichiers dans un dossier de sauvegarde, et surtout tester avant de convertir si le fichier est bien en iso-8859. Malheureusement je suis nul en bash, et je n'y arrive pas :
#!/bin/sh
mkdir backup.iso8859
chemin="1ドル"
for ii in "$chemin"
do
tt=`file "$ii" | grep ISO-8859`
if [ $tt -ne '' ]
then
iconv -f ISO-8859-15 -t UTF-8 "$ii" -o "$ii.utf8"
mv "$ii" "backup.iso8859/$ii.iso8859.old"
mv "$ii.utf8" "$ii"
fi
done
Only wimps use tape backup: real men just upload their important stuff on megaupload, and let the rest of the world ~~mirror~~ link to it
[^] # Re: iconv
Posté par B16F4RV4RD1N . En réponse au journal L'utf-8 et les décideurs. Évalué à 2.
Only wimps use tape backup: real men just upload their important stuff on megaupload, and let the rest of the world ~~mirror~~ link to it