Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to send am email...

Status
Not open for further replies.

kumariaru

IS-IT--Management
Mar 9, 2006
61
AU
Hi All...
I am trying to execute below script to check the count of multiple files in the MAIN folder. And if the count is 2 then send an email with the file name. If there are two files with line count 2 then send 2 emails with respective filnames.
I was given this code for my previous post. I am trying to execute this and getting an error wc: cannot open /home/folder/MAIN/

Script:
wc -l /home/folder/MAIN/* > /dev/null | while
Read nr name;do test
$NR -eq 1 && mutt -a "$name" -s "the count of the $name is one" tom345@yahoomail.com;
done


Thanks in advance..

 
Hi Feherke..
Yes I have readable and executable permissions for the folder and the MAIN folder exists in the path..I created a script to do word count of a file from the MAIN folder and it is giving the output....

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top