Initially, I wanted a script to extract from a file that I name, the size of the file and last time it was modified. Then I remembered that someone posted a command line equivalent to "Get Info" in the Finder. I've searched the forums and can't find the thread. I thought I could piece some code together to do what I need it to do. I just need a script to determine whether or not a text file has anything in it, if it does, then the script needs to check the last time it was modified, let's say 20 minutes. If the file is empty, the script does nothing, other than check the text file again in 20 minutes via running as a cron job. The reason I'm doing this is for a project at work. Part of my job is to maintain four Open Access (anyone can use the equipment) NMR laboratories. The Varian NMR instruments (
http://www.varianinc.com/cgi-bin/nav?products/nmr/index&cid=IJQMIQJFO) are controlled by Sun Microsystems workstations running Solaris 8. These instruments are completely automated (
http://www.varianinc.com/cgi-bin/nav?products/nmr/accessory/auto_samplers/sms/index&cid=IJQMIJLFP) with very fast robotics. A previous employee wrote a series of shell scripts that does quite a bit more, sorry I don't want to say what they do for fear of breach of confidentiality. Pharmaceutical companies are very protective of methods developed in-house to streamline, make research more efficient, and less costly. Occasionally, this Varian software just silently stops running and no experiments are running-that costs A LOT OF MONEY WHEN THEY SIT IDLE, I suggested to my supervisor that a shell script be written that runs as a cron job to check a text file over a specified time frame. The script's job is to detect when the Varian automation software and hardware hangs up. Code already exists in other shell scripts on what to do when an error occurs.
Late Friday afternoon my supervisor said that if I can't write the code, he can find someone who can, he just needs from me a logic diagram of the program to give to someone else. And I can't post a diagram here without giving away other parts of the custom shell scripts that do everything else. I'm stuck between a rock and a hard place. I don't want to depend too much on other people, because this is a good learning experience, and I want to do as much of it myself as I can. I like programming, I just don't know enough about C/C++ or shell scripts.
About 14 years ago, I wrote a report generator for the hospital department I was working in, to finance my college education. The medical reports up to that time were recorded on dictation equipment, and a secretary had to listen to the dictation cassettes and type EVERYTHING on the tape. I said "I can make this whole process much more efficient", not even knowing if I could do it. One year later, a magnificent series Word Perfect Macros, the "Report Generator" was completed. My supervisor implemented it, report turn-around times decreased substantially, reports were made more efficiently, Vice Presidents were notified, and hospital programmers used my Report Generator as a model for other departments. In the end, I got an excellent job review, a letter of commendation placed in my employee file, and I was the "wiz kid" of the department until I left.