I need a python script written that will do the following on a unix machine
-get the name of the host the script is running on. store it in variable $host
-search a given directory path for the latest modified file. return the filename
-search this file for "somthing". somthing will be a given variable
-if somthing is found an email is sent to
To: some@[url removed, login to view]
From:no@[url removed, login to view]
Subject: Found IT
Msg found: found somthing in $filename on $host
-in the msg it should return the line before the line somthing was found in, the line containing the text and the line after the text.
-if nothing is found no email should be sent
The directory search and the file search should be contained in two seperate functions so it easily reused.
the return of searchDirectory should $filename. searchFile Should email if string as found as described above.