The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Whats wrong in the script? nehagupta2008 UNIX for Dummies Questions & Answers 1 06-02-2008 03:24 AM
tell me whats wrong with this nadman123 Shell Programming and Scripting 1 04-14-2008 08:58 PM
Whats wrong with this script? kayarsenal Shell Programming and Scripting 2 08-25-2006 06:58 AM
Whats wrong with this 5 line script! c19h28O2 Shell Programming and Scripting 9 05-10-2006 10:04 PM
whats wrong with this awk??? george_ Shell Programming and Scripting 5 04-04-2006 01:58 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-30-2007
Registered User
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
Whats wrong in this Script ???

PATH="/clocal/mqbrkrs/user/mqsiadm/sanjay"
MAIL_RECIPIENTS="xyz@abc.com"
Subject="File accessed in last minutes:"

find $PATH -type f -amin -1 > temp.txt.$$
cat temp.txt.$$ | \
while read line
do
fuser -uV $line >> tempmail.txt
done

cat "$tempmail.txt" | mailx -s "$Subject" $MAIL_RECIPIENTS
rm temp.txt.*


This script is giving Errors like when i run this script:
AccessMonitor_Script[7]: find: not found.
AccessMonitor_Script[8]: cat: not found.
AccessMonitor_Script[14]: cat: not found.
AccessMonitor_Script[14]: mailx: not found.
AccessMonitor_Script[15]: rm: not found.

Do you have any Idea about this ??

Thanks!!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-30-2007
robotronic's Avatar
Can I play with madness?
 

Join Date: Apr 2002
Location: Italy
Posts: 370
Remember that the variable "PATH" is "reserved" for the system! With your PATH assignation you're breaking your environment!

Try changing the variable "PATH" with "MYPATH" and retry
Reply With Quote
  #3 (permalink)  
Old 08-30-2007
Registered User
 

Join Date: Aug 2007
Posts: 45
PATH=........ is not enough you must export your path.
PATH=....
export $PATH after this you can change your environment
Reply With Quote
  #4 (permalink)  
Old 08-30-2007
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Milan, Italy/Varna, Bulgaria
Posts: 1,564
Quote:
Originally Posted by fazliturk View Post
[...]PATH=....
export $PATH after this you can change your environment
ITYM export PATH
Reply With Quote
  #5 (permalink)  
Old 08-31-2007
Registered User
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
fuser command ??

Thanks for the Reply !
Ya i got it !!

I want to ask one thing in that ...
here i have written a line using command fuser, its not working for some file but its working for directory. Do you have any idea about this command.
I have looked into man fuser, which shows ProcessNumber and the user name (-c) who has accessed that.


Thanks !!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:12 PM.


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 Global Fact Book

Content Relevant URLs by vBSEO 3.2.0