Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: pauls@locust.cic.net (Paul Southworth)
Subject: Re: chown-oddities?
Date: 11 Nov 1994 15:34:38 GMT	[thread overview]
Message-ID: <3a02uf$grq@spruce.cic.net> (raw)
In-Reply-To: 39sn7h$gjl@hermes.uni-konstanz.de

In article <39sn7h$gjl@hermes.uni-konstanz.de>,
Eberhard Heuser-Hofmann <vaxinf@chclu.chemie.uni-konstanz.de> wrote:
>I'm not sure if it's a feature of chown or a bug of OSF/1 V3.0:

Welcome to unix!  "chown" is working just fine and OSF/1's chown is
not buggy as far as I know.  comp.unix.shell and comp.unix.questions are
good places to ask these types of questions -- your question is not
specific to OSF/1 at all.

>chown -R "newowner" *
>
>modifies the ownership of all files to "newowner" exept of all .xxx file , i.e. .login.
>
>But:
>
>chown -R "newowner" .*
>
>runs through all files beginning from /rooted-dir!

Yep, because that's what you just told it to do.  "." is the current
directory, and ".." is the parent directory, so ".*" matches all dot-files
in the current directory, plus all of the parent directory.  There are
fairly easy ways around this.  First, this will decend through all 
directories in the current directory (including the current directory itself)
and chown all files (not directories) that match .*

find . -type f -name ".*" -exec chown newowner {} \;

Or this can be used to avoid matching "..".  It will also fail to match
any files starting with "." that have names of only two characters:

chown -R newowner .??*

Of course, if you really want to just chown all of the contents of
a directory, just do:

( cd .. ; chown -R newowner directoryname )

>Remark: why is there no verbose-option in chown to see what happens?

Because you didn't write it yet, and nobody else saw the need.  You can
get sources to chown on prep.ai.mit.edu:/pub/gnu/fileutils-3.12.tar.gz.
Then you can hack in whatever additional output you think it should have.

--
Paul Southworth
CICNet Systems Support
pauls@cic.net


  parent reply	other threads:[~1994-11-11 15:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-10  8:56 chown-oddities? Eberhard Heuser-Hofmann
1994-11-10 21:26 ` chown-oddities? Peter da Silva
1994-11-11 15:34 ` Paul Southworth [this message]
1994-11-12  1:13   ` chown-oddities? Phil Knaack
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox