can i do it in php? it is the same recursion problem
with the mp3 renaming a while ago.


elky_chown.php
------------------ cut the code here -------------------------

<?php

  $handle=opendir( '/home' );

  while (false!==($dir = readdir($handle)))
  {
      if ($dir != "." && $dir != "..")
      {
           $command = "chown -R ".$dir." .users ".$dir;
           system( $command );
      }
  }

  closedir($handle);
?>

------------------ cut the code here -------------------------


at the shell prompt type

  shell> php /file_path/elky_chown.php



*NOTE: i've assumed that the home dir == user.
** php must be installed


HTH





Elky Grrrr... wrote:

hi i have a /home/samba folder that holds the samba
user's home directories, ok, so for some reason the
owner of each directory is "stto" and is in the group
"users". there are about a hundred directories!! dont ask me how it happened... the admin must be
smoking weed again!!! now, i could always do "chown
-R daustria.users daustria", but i have to do it on
all the folders one by one!! how can i change it all
using bash? or perl?
each user's home directories is the same as the user
name of the users

thanks a lot



_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph

To subscribe to the Linux Newbies' List: send "subscribe" in the body to [EMAIL PROTECTED]

Reply via email to