getenv - unix - fp 5.0.13

Bob Stockler bob at trebor.iglou.com
Wed Mar 10 14:03:11 PST 2004


On Wed, Mar 10, 2004 at 01:18:30PM -0800, Enrique Arredondo wrote:
| From: "Bob Stockler" <bob at trebor.iglou.com>
| >   #!/bin/sh
| >   # Shell Script named "flog"
| >   # This will loop and read the value for "argument"
| >   # every time anything is piped into it:
| >   while read argument
| >   do /usr/vsifax/bin/flog -a $argument
| >   done
| >
| > I think this processing will give you a start on your
| > output processing table:
| >
| >          If: NOT Start
| >        Then: gosub Start ; declare answer
| >        Then: getname = 2
| >        Then: answer  = getname
| >        Then: ' other stuff you want to do with "answer"
| >        Then; end
| >   Start  If: ' The USER command must be alone on a line by itself:
| >        Then: USER getname = /path/to/shell/script/named/flog
| >        Then: return ' above should be unquoted full absolute pathname
| 
| I tried it but the script is looping somehow , so I just change it to :

It's supposed to loop.

When filePro executes the USER command it opens
a 2-way pipe to the program being executed.

When it encounters  alias = "value"  it sends
"value" to the standard input of that program.
That program sends its reply to its standard
output which filePro reads into "variable"
when it hits the  variable = alias  line.

The script I suggested pauses at the "while read"
line until it gets something sent to it standard
input, then executes the commands in it and sends
a reply to its standard output, loops and waits
once more at the "while read" line for the next
thing sent to it.

| # script named flogit
| #!/bin/sh
| /usr/vsifax/bin/flog -a $1 | cut -c56-
| 
| and if I ran it in the shell
| 
| flogit 123445

The USER command doesn't execute a program by passing
variable arguments to it.  The program has to read its
standard input.

| responds with   "NORMAL 1 "
| 
| when I ran the processing as you suggested it's breaking out of the report.
| Is it because USER doesn't work when using rreport instead of rclerk ?
| 
| report wuhistfax -f poststatus -a -u
| 
| Or is flog sending strange control characters before the response and
| filepro is freaking out with that R1C??R2,...

I have no idea what "R1C??R2...." represents or how
it got into the discussion.

Bob

-- 
Bob Stockler - bob at trebor.iglou.com
Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
Fully functional (time-limited) demos available by email request (specify OS).


More information about the Filepro-list mailing list