The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Simple Script mojoman Shell Programming and Scripting 6 05-12-2008 12:55 AM
simple script help ali560045 Shell Programming and Scripting 4 01-24-2008 02:24 AM
simple script ali560045 Shell Programming and Scripting 1 01-22-2008 01:41 AM
Simple Script Help Skunkie UNIX for Dummies Questions & Answers 4 10-02-2006 08:18 AM
simple awk script... moxxx68 Shell Programming and Scripting 3 01-24-2005 01:17 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 02-23-2004
Registered User
 

Join Date: Jun 2001
Posts: 35
simple script

guys,

I have a need for a simple script that scans all of our users home directories (/home/*) and looks to see if the executable bit is on. If it finds that a user has a file with an executable bit on, it will send an email to managment. (no users are supposed to have any programs of their own on the production server).

My question is getting started on this. Do I need a 'for' loop to read thru each directory?
Reply With Quote
Forum Sponsor
  #2  
Old 02-23-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,609
find /home -type f -perm -111 -print
Reply With Quote
  #3  
Old 02-23-2004
Registered User
 

Join Date: Jun 2001
Posts: 35
thanks Perderabo! Thats exactly what I needed
Reply With Quote
  #4  
Old 02-23-2004
Registered User
 

Join Date: Jun 2001
Posts: 35
one last thing... what if I wanted to ignore a standard subdirectory under each home directory? For example:

/home/user1/.dt


I want to ignore all of the .dt directories
Reply With Quote
  #5  
Old 02-23-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,609
Then there's really no point to this since that's where users will store their executables

But pipe the find to something like:
| grep -v /.dt/
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0