This in not actually a bash script, but useful anyway. It is supposed to do something to each normal user on the system. This version makes a new folder (or directory if you prefer) in their $HOME, but just changing the line with the system call will let you do lots of other useful stuff like sending a mail to all users or whatever you can imagine. Of course, you will probably have to be root to use the script if it needs to write in the users' $HOMEs. Oh, for the mail-to-all version, just cange the system line to something like: system("cat mailtextfile | mail -s "System down for maintenance tomorrow" $username"); Since I used the -w flag, perl will issue warnings for each field in the userentry which is not used. These warnings can be disregarded. Regards Ole #!/usr/bin/perl -w # Just open the the passwd file and read it quickly open FILE, "/etc/passwd" or die "Where are my users???"; @userlist = <FILE>; close FILE; foreach $userentry (@userlist) { # Split the userentry into atoms. # Note that the password often does not contain anything useful, # but it is still a field, so we have to consider it anyway. ($username, $password, $userID, $groupID, $fullname, $home, $shell) = split(':',$userentry); # The 'nobody' user is usually not above UID 500, but just making sure. if ($UID >= 500 && $username ne 'nobody') { # Give each existing user a new folder and set ownership and permissions system("mkdir $home/foldername && chown $username:users $home/foldername && chmod 0700 $home/foldername"); } }