filePro/email from Unix script file

Jeff Harrison jeffaharrison at yahoo.com
Wed Dec 14 13:41:39 PST 2005


--- Butch Ammon <butch at rich.srcoils.com> wrote:

> 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
>
-----------------------------------------------------------------------------
[snip]

One way to do this would be to put your mail commands
inside an "if" block as follows:

/appl/fp/dreport (etc)
if [ -s /tmp/partscheck]
then
mail -s (etc)
mail -s (etc)
fi

This should only do the mail commands if the file
exists and has a size greater than zero.

I hope that helps.

Jeff Harrison
jeffaharrison at yahoo.com

Author of JHExport and JHImport.  The easiest and
fastest ways to generate code for filePro exports and
imports.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Filepro-list mailing list