USER command newbie REVISED
Bob Stockler
bob at trebor.iglou.com
Wed Jun 8 10:56:38 PDT 2005
Walter Vaughan wrote (on Wed, Jun 08, 2005 at 11:45:51AM -0400):
| <reposted to correct typing error. I manually typed in second line
| incorrectly>
|
| For testing purposes I have in a sample file's input processing table @key
| processing like the following:
|
| @keyT::user phone = /usr/local/bin/ssh ff at facetphone
| /usr/facetphone_utapi/bin/fp_cid -n -s -u person:
| ::ph = phone:
| ::msgbox ph:
| ::end:
|
| What seems odd to me is
What seems odd to me is that you didn't first send something
to the USER program before asking it what it returned.
| 1) why cannot the user command be called from a variable?
The USER command syntax has always required the user program to
be an unquoted name (if in $PATH) or pathname.
| 2) why does "ph" only contain data for the first time it is encountered on a
| processing table? Moving record to record, ph is blank every time the user
| command is run. I could see that if I stayed on the same record, but moving
| from record to record?
Here's how I understand the use of USER:
1 - The USER program itself is one that loops, reading a string
sent to it, and returning to the filePro program the results
of whatever action it took on the string it received.
2 - The "USER name = pathname" is executed only once, then the
processing loops to send a string to the USER program and then
read what's returned.
I'm not even sure that the arguments to "/usr/local/bin/ssh" are
being read by filePro. I do know that the rule is that nothing
other than there is supposed to be nothing other than the USER
command on the line, and perhaps filePro reads up to the end of
the pathname and quits. Just the other day I tried to redirect
the standard error of a user program to a file:
Then: USER prog = /tmp/script 2>/tmp/errors
and the redirection was ignored (though I got no syntax error, as
one might get if a comment was put on that line).
I don't understand the command you're trying to use, but is "person"
in it a long name variable?
Are you trying to use that command over and over, from record to
record, and getting a different response with each record?
I think you want to put your command within a shell script that loops:
trap '' 2
while read person
do /usr/local/bin/ssh ff at facetphone \
/usr/facetphone_utapi/bin/fp_cid \
-n -s -u $person
done
and, in your table:
Then: USER pnone = /path/to/script
Loop If:
Then: phone = person
Then: pn = phone ; msgbox pn ; goto Loop
[snipped some stuff I couldn't read]
I could probably be of more help if I better understood exactly what
you are trying to do.
Bob
--
Bob Stockler - bob at trebor.iglou.com - http://members.iglou.com/trebor
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