[gull] Problèmes charactères MacOSX
Leopoldo Ghielmetti
Leopoldo.Ghielmetti at a3.epfl.ch
Sat Sep 11 00:56:07 CEST 2004
Tu peux aussi eliminer le if [ ! -f "${path}" ] en utilisant le find à
fond.
#!/bin/sh
find . -type f -print |\
while read path
do
dir=$(dirname "${path}")
file=$(basename "${path}")
lc=$(echo "${file}" | tr '?\[\]/\\=+<>;:",|*' '-')
if [ ${lc} != "${file}" ]
then
newfile="${dir}/${lc}"
touch "${newfile}"
test $? = 0 && mv "${path}" "${newfile}"
fi
done
ciao, Leo
Il ven, 2004-09-10 alle 17:10, Daniel Cordey ha scritto:
> On Friday 10 September 2004 17:02, Daniel Cordey wrote:
>
> > La commande 'find' peut extraire une arborescence. Voila, je modifie ton
> > script :
>
> AIE................ STOP ..............
>
> J'ai oublie un truc important... donc le script est :
>
> #!/bin/sh
> find . -print |\
> while read path
> do
> dir=$(dirname "${path}")
> file=$(basename "${path}")
> if [ ! -f "${path}" ]; then continue; fi
> lc=$(echo "${file}" | tr '?\[\]/\\=+<>;:",|*' '-')
> if [ ${lc} != "${file}" ]
> then
> newfile="${dir}/${lc}"
> touch "${newfile}"
> test $? = 0 && mv "${path}" "${newfile}"
> fi
> done
>
> Daniel
>
> ______________________________________________
> gull mailing list
> gull at lists.alphanet.ch
> http://lists.alphanet.ch/mailman/listinfo/gull
>
>
More information about the gull
mailing list