Quote:
Originally Posted by
Juha
### Find out the owner/user name for that Process
### Replace the $access_user_filed with the filed no from the ps -ef
### command
user = `ps -ef | grep $pid | awk '{ print $1 }'` (I think you need the single quotes here?)
echo " $file_dir access by the $user " >> tempmail.txt " (here you have 3 " characters)
done
I have removed last double quote that was used in echo command. Thats fine.
Now when I add single quotes in awk, as you mentioned, then it gives error on grep command.
AccessLogMonitor_script[14]: pid: not found.
Usage: grep [-r] [-R] [-H] [-L] [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] -e pattern_list...
[-f pattern_file...] [file...]
Usage: grep [-r] [-R] [-H] [-L] [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] [-e pattern_list...]
-f pattern_file... [file...]
Usage: grep [-r] [-R] [-H] [-L] [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] pattern_list [file...]
AccessLogMonitor_script[19]: user: not found.
How to solve this
?? Please help !!