Computing.Net > Forums > Unix > script help

script help

Reply to Message Icon

Original Message
Name: Jernand
Date: March 24, 2005 at 09:36:09 Pacific
Subject: script help
OS: hp-ux
CPU/Ram: 1280mb
Comment:

Hi,

In a directory I would like to search for files with a particular ownership say "tom" and if I find any files with that ownership then I would change the ownership to "jerry" and also change the permission of the file to 555. How can I accoplish this with a script. This script shud run contineously in the background. Thanks

Regards,
Jern


Report Offensive Message For Removal


Response Number 1
Name: David Perry
Date: March 24, 2005 at 12:44:52 Pacific
Reply: (edit)

man find
man crontab
man sleep

for file in `find / -type f -user tom` ; do
chown jerry $file
chmod 555 $file
# are you REALLY sure want to execute chmod?
done


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: script help

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge