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.