Chown script

Franco primo at ischianet.com
Thu Oct 21 17:16:24 UTC 2004


I have resolved with this script:

#!/bin/sh

for folder in `ls /home/`

do

for I in `ls /home/$folder/homes/`

do

   chown $I.$folder /home/$folder/homes/$I

done
done

seen that the group have the same name of the parent folder i
have taken it as group and so i have resolved.
Thanks.


Paul Howarth ha scritto:
> Franco wrote:
> 
>> Thanks Paul but i need to chown just the user of the
>> folder but the user must to be so foldername.foldergroup
>> i not need to change the group.
>>
>>
>>
>> Paul Howarth ha scritto:
>>
>>> Franco wrote:
>>>
>>>> Hi, this script give me an error `ls': not a valid user
>>>> i need to change the owner with a foldername.group
>>>> i need to read a group of the folder and then change it with
>>>> foldername.group group
> 
> 
> You've lost me now; I think you need to give more examples.
> 
> * Name of file
> * Current user ID of file
> * Current group ID of file
> * New user ID of file
> * New group ID of file
> 
> My understanding was:
> 
> * Name of file = username
> * Current user ID of file = something-wrong
> * Current group ID of file = somegroup
> * New user ID of file = username
> * New group ID of file = somegroup
> 
> Are you saying that:
> 
> * New user ID of file = username.somegroup
> * New group ID of file = somegroup
> 
> Do all the accounts username.somegroup exist in your /etc/passwd ?
> 
> Paul.
> 
> 




More information about the fedora-list mailing list