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

Re: chown des fichiers cachés



Bonjour,

On 2012-01-21 23:19:29 +0100, ajh.valmer@free.fr wrote:
> Comment modifier les propriétaires (nom et groupe) des fichiers cachés
> (commençant par un point) ?
> 
> Si je fais :
> # chown  -Rf   andre:andre   /home/andre/.*
> c'est le répertoire inférieur "/home" qui se voit modifier
> les droits par "andre andre",
> ainsi que ceux des autres répertoires des autres users.

C'est parce qu'en sh POSIX .* matche "." et "..".
Solution: utiliser zsh!

  FILENAME GENERATION
[...]
    In filename generation, the character `/' must be matched
    explicitly; also, a `.' must be matched explicitly at the
    beginning of a pattern or after a `/', unless the GLOB_DOTS
    option is set. No filename generation pattern matches the
    files `.' or `..'. In other instances of pattern matching,
    the `/' and `.' are not treated specially.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: