<div> Well, I added at the end:</div>
<div> </div>
<div> Then: write deb; end</div>
<div> </div>
<div>@done Then: system "do_my_script"<fd</div>
<div> </div>
<div> This works - and emails the file with no problem using my mutt script (which uses sendmail)</div>
<div> </div>
<div> Problem is, the text file attachment isn't complete?? It quits on the 30th record, about mid-way thru.</div>
<div> </div>
<div> So I vi the text file on the SCO box and all 44 records are in the file I'm sending?????</div>
<div> </div>
<div> So I tried putting a sleep 100000 command right before the system call, but still same issue.</div>
<div> </div>
<div> Any idea why it doesn't send me the whole file??</div>
<div> Very strange......</div>
<div> </div>
<div> My mutt script looks like this:</div>
<div> </div>
<div> #!/bin/sh</div>
<div> </div>
<div>cd /appl/fpmerge (<--- this is where the file (fd) gets created)</div>
<div> </div>
<div>FLE=$1</div>
<div> </div>
<div>mutt -s "File you created is attached" -a $FLE my_email@..... < mailbody.txt (<--- mailbody.txt is just a generic text file saying "file attached")</div>
<div> </div>
<div>Would it make a difference if root or filepro owns the mutt script? (I'm going to try to change that and run it again now)</div>
<div> </div>
<div>Thanks guys</div>
<div> </div>
<div>I knew it was something pretty obvious - just couldn't think of what it was - brain dead lol</div>
<div> </div>
<div>Scott</div>
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Thu, Oct 7, 2010 at 12:59 PM, Brian K. White <span dir="ltr"><<a href="mailto:brian@aljex.com">brian@aljex.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im">On 10/7/2010 11:34 AM, <a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a> wrote:<br></div>
<div>
<div></div>
<div class="h5">> I have an export ascii out put processing script that I want to setup to<br>> email after it finishes.<br>><br>> Currently, in output processing, I use variables to create filename based on<br>
> today's date, etc and that all works fine<br>><br>><br>> Then: export ascii deb=(fd) r=\n f=|<br>><br>> Then: deb(1)=1, etc, etc, etc<br>><br>> Then: write deb; end<br>><br>> Now, after this finishes with all the records selected via set selection, I<br>
> want to email the file, passing the variable filename to the script<br>><br>> I thought easiest way would be to do a system call at the end, but if I<br>> change<br>><br>> Then: write deb; end<br>> to<br>
> Then: write deb<br>><br>> Then: system "path_to_my_script"< fd<br>><br>> obviously this calls the system call after each record is written to the<br>> file - resulting in numerous emails of course haha<br>
><br>> So, my next thought would be from the menu, to script it as:<br>><br>> /u/appl/fp/rreport ............<br>> cd /appl/fpmerge<br>> ./script_name_to_send_email ???????<br>><br>> So how would I get the filename (fd) as defined in processing, passed to the<br>
> email in the Create Script File (F5) in the define menus??<br>><br>> Either that, or how do I do a system call ONLY after all records have been<br>> written to my output file??<br>><br>> Thanks for any help<br>
<br><br></div></div>My suggestion for the most self-contained and thus portable and<br>maintainable way:<br><br>Do the post-processing (send the email in this case) in @done.<br>This means declare fd with ,g so that it is still available in @done.<br>
And since in this case the value in fd doesn't change during the entire<br>run and doesn't depend on any record data, and assuming you have fp 4.8<br>or newer, the simplest and best place to declare and fill fd is in<br>
@once. (no need to check "i did/didn't do this already" on every record)<br><br>Lastly, to avoid possible permissions problems, You might need to use a<br>system command to create the file before allowing fp to create it.<br>
Again, best in @once.<br><br>top of prc<br> normal per-record output processing<br> [...]<br> end<br><br>@once:<br> fd(32,*,g) = "/tmp/something.txt" ' don't use rand()!<br> ' system "umask 0 ; >" < fd ' may not need, try without first.<br>
end<br><br>@done:<br> close deb<br> system "..." < fd<br> x = remove(fd)<br> end<br><br><br><br>This way requires no special set up before nor after running<br>report/clerk. It's all within the processing table.<br>
<font color="#888888"><br>--<br>bkw<br>_______________________________________________<br>Filepro-list mailing list<br><a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>Subscribe/Unsubscribe/Subscription Changes<br>
<a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br></font></blockquote></div><br>