filePro/email from Unix script file

Bill Campbell bill at celestial.com
Wed Dec 14 12:46:47 PST 2005


On Wed, Dec 14, 2005, Butch Ammon 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"?

One way that should work with any reasonable shell would be to
test for a file of zero size.  ``test -s'' returns the size of
the file, and should do the trick.

test -s $filename && {
	# do things here.
}

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software LLC
UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

When I hear a man applauded by the mob I always feel a pang of pity
for him.  All he has to do to be hissed is to live long enough.
		-- H.L. Mencken, ``Minority Report''


More information about the Filepro-list mailing list