filePro/email from Unix script file
Butch Ammon
butch at rich.srcoils.com
Wed Dec 14 12:01:52 PST 2005
Good afternoon,
I am trying to help my Minneapolis office (Super Radiator Coils) with an idea
they have with filePro on SCO Unix. I made a real simple script file for them
to run a filePro report to a /tmp file. Then immediately email the /tmp file.
But... what happens when the filePro report runs and doesn't happen to select
any records? The script file continues and emails a blank report!
Is there a quick way to kill the script file when the records selected is "0"?
example:
-----------------------------------------------------------------------------
#/usr/bin/partscheck - Butch 5/2/02
#
/u/appl/fp/dreport purchase -f partscheck -s partscheck -u -p /tmp/partscheck
mail -s "parts check report" kari at rich.srcoils.com < /tmp/partscheck
mail -s "parts check report" linda at rich.srcoils.com < /tmp/partscheck
-----------------------------------------------------------------------------
I wrote the tiny script file above in May 2002. It just runs dreport from our
purchasing file, redirects the report to a /tmp file (/tmp partscheck), and then
uses the simple "mail" command to email the report to Kari and Linda here at
Super Radiator. ...easy. ....A 10 second script file to write.
But again, what happens if there are no records selected? The report will still
run, and create a blank /tmp file report and email it anyway.
Can I use the "trap" command to verify the /tmp file or verify if filePro has
run and selected records? If TRUE then run the mail command and email the
report. If FALSE or "0" records selected, then bail out, quit and exit.
I know there is a real simple way, but I just can't think of it at the moment.
Thank you!
Butch Ammon
Super Radiator Coils
Richmond, VA
More information about the Filepro-list
mailing list