[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [HS] Tip: Renommer des fichiers dans son éditeur



Le 31 août 2010 15:29, Quentin Lamy <quentinlamy1@gmail.com> a écrit :
>
> 2010/8/31 Kevin Hinault <hinault@gmail.com>:
> >
> > Par contre ca doit marcher ça :
> > find FOO/ -type f -exec rename  'y/A-Z/a-z/' {} \;
>
> Non, ça essaie de renommer FOO/ONE.txt en foo/one.txt => erreur

$ ls -1 FOO/
FOO.TXT

$ find FOO/ -type f | perl -e 'map({chomp;/(.*\/)(.*)/;rename($_,$1.lc $2)}<>)'

$ ls -1 FOO/
foo.txt

Ouais là j'abuse et il est surement possible de faire mieux :D
Mais je prend le large et mon boulot m'attend ...

--
Kévin


Reply to: