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 Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 07:24 AM
tell me whats wrong with this nadman123 Shell Programming and Scripting 1 04-15-2008 12:58 AM
Whats wrong with this script? kayarsenal Shell Programming and Scripting 2 08-25-2006 10:58 AM
Whats wrong with this 5 line script! c19h28O2 Shell Programming and Scripting 9 05-11-2006 02:04 AM
whats wrong with this awk??? george_ Shell Programming and Scripting 5 04-04-2006 05:58 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 08-30-2007
varungupta varungupta is offline
Registered User
  
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 206
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!!
  #2 (permalink)  
Old 08-30-2007
robotronic's Avatar
robotronic robotronic is offline Forum Advisor  
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
  #3 (permalink)  
Old 08-30-2007
fazliturk fazliturk is offline
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
  #4 (permalink)  
Old 08-30-2007
radoulov's Avatar
radoulov radoulov is online now Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,926
Quote:
Originally Posted by fazliturk View Post
[...]PATH=....
export $PATH after this you can change your environment
ITYM export PATH
  #5 (permalink)  
Old 08-31-2007
varungupta varungupta is offline
Registered User
  
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 206
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 !!
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 09:56 AM.


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