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

Re: [K12OSN] Permissions?



jamie said:
> I need for the ownership of the
> files to be the same as the directory I am copying them into.

Eric Harrison wrote this. Works like a champ.

-Dan Young
-Parkrose School District

#!/bin/sh

# a quick and dirty script to reset user/group ownership of files
# in /home

cd /home
DIRS="`ls | grep -v samba`"

for DIR in $DIRS
do
        if [ -d $DIR ]
        then
                U="`id -u $DIR`"
                G="`id -g $DIR`"
                if [ "$U" -a "$G" ]
                then
                        chown -Rv ${U}:${G} $DIR
                else
                        echo "PROBLEM with $DIR"
                fi
        fi
done







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