The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 03:55 AM
simple script help ali560045 Shell Programming and Scripting 4 01-24-2008 05:24 AM
simple script ali560045 Shell Programming and Scripting 1 01-22-2008 04:41 AM
Simple Script Help Skunkie UNIX for Dummies Questions & Answers 4 10-02-2006 11:18 AM
simple awk script... moxxx68 Shell Programming and Scripting 3 01-24-2005 04:17 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-23-2004
hedrict hedrict is offline
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?
  #2 (permalink)  
Old 02-23-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
find /home -type f -perm -111 -print
  #3 (permalink)  
Old 02-23-2004
hedrict hedrict is offline
Registered User
  
 

Join Date: Jun 2001
Posts: 35
thanks Perderabo! Thats exactly what I needed
  #4 (permalink)  
Old 02-23-2004
hedrict hedrict is offline
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
  #5 (permalink)  
Old 02-23-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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/
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0