Re: Chown script

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

 



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 don't need to read the group name if you're not going to change it. You can just correct the userid without changing the groupid. The script I posted changes the userid and not the groupid.

antonio tuozzo ha scritto:

Franco wrote:

Sorry,
i do an example, i have 2 folder in the same parent folder,
pippo and pippo1 these have as owner and group pippo and pippo.
I need to change just the owner in pippo.pippo and pippo1.pippo


If I have understand the problem....

for I in 'ls /path/to/folder'


The problem you were seeing above is due to the quotes being wrong.

It should be ` rather than ' (both of them)

do
   chown $I.pippo $I
done


This will make the groupid of all folders "pippo". If you don't want to change the groupid, delete the ".pippo" from the chown command.

Paul.



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux