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

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



* Kevin Hinault <hinault@gmail.com> [2010-08-31 16:38:09 +0200] wrote :

> 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 ...

avec zsh :

$ autoload zmv 
$ zmv '(*)' '${(L)1}' 

pour remettre en majuscule :

$ zmv '(*)' '${(U)1}'

:)

-- 
 .''`.  Edi Stojicevic
: :'  : Debian GNU/Linux user, admin & developer - http://www.debian.org 
`. `~'  Debianworld.org founder - http://www.debianworld.org 
  `-    
Don't hit the keys so hard, it hurts.


Reply to: