Share Pastebin
Guest
Public paste!

Aram

By: a guest | Mar 21st, 2010 | Syntax: Bash | Size: 0.41 KB | Hits: 76 | Expires: Never
Copy text to clipboard
  1. #!/bin/sh
  2.  
  3. # change this to the directory you are interested in, if you want user home
  4. # directory use $HOME
  5. WRK_DIR=/tmp
  6.  
  7. # test if we called the script with proper arguments
  8. if [ "$#" -ne "1" ] ; then
  9.         echo "Script must be called with 1 parameter"
  10.  
  11.         exit 1
  12. fi
  13.  
  14. # ENEMY is the name passed as a parameter
  15. ENEMY="$1"
  16.  
  17. # do our stuff
  18. find $WRK_DIR -user $ENEMY -print0 | xargs -0 chown $USER