4 Replies Latest reply: Apr 29, 2010 5:25 AM by Barney-15E
MacUserKHS Level 1 Level 1 (0 points)
Hello,

Looking for a scipt to delete user profiles - hopefully in UNIX but any
automated way will work.

Need to exclude administrator and shared folders or any system folders under /Users

The following is a rough example of what is being worked on but not sure how to exclude administrator from the rm statement.
I am still new to macs thanks

#!/bin/bash

#This deletes all Macintosh profiles except admin,share,.localized


Profile="$Users/*"

Admin="

for Profile in $Profile
do
if [[ -e $Profile ]]
then
rm -rf $Profile

fi
done
exit

IMAC, Mac OS X (10.5.5)