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

Re: NO! chmod strikes!



%% Dave Carrigan <dave@rudedog.org> writes:

  dc> "Paul D. Smith" <pausmith@nortelnetworks.com> writes:

  >> BTW, the best way to do what you wanted to do is this:
  >> 
  >> $ chmod -R o-owx .[!.]*

  dc> Or even better, ignore the -R in the chmod command and use find:

  dc>   find . -print0 | xargs -0 chmod r-owx

Not to be argumentative, but what's better about it?


First, your example doesn't do what the OP wanted to do, or what my
example does do.  In order to do that you _still_ have to use my
globbing expression (or else use some truly bizarre contortion in
find--see other posters to this thread as they try to come up with one):

  find .[!.]* -print0 | xargs -0 chmod r-owx

Second, your example has a lot more typing in it, and although anyone
doing UNIX sysadmin needs to be familiar with this pattern, it's
definitely more complex than -R.

You _could_ have argued that the -R flag is not standard, and so the -R
version won't work everywhere... but the -R is a lot more portable and
works on a lot more versions of UNIX than the find -print0/xargs -0
flags, which _only_ work with GNU find and xargs.


So... I'm not seeing it :).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@baynetworks.com>    HASMAT--HA Software Methods & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.



Reply to: