Aram
By: a guest | Mar 21st, 2010 | Syntax:
Bash | Size: 0.41 KB | Hits: 76 | Expires: Never
#!/bin/sh
# change this to the directory you are interested in, if you want user home
# directory use $HOME
WRK_DIR=/tmp
# test if we called the script with proper arguments
if [ "$#" -ne "1" ] ; then
echo "Script must be called with 1 parameter"
exit 1
fi
# ENEMY is the name passed as a parameter
ENEMY="$1"
# do our stuff
find $WRK_DIR -user $ENEMY -print0 | xargs -0 chown $USER