USER command newbie REVISED

Brian K. White brian at aljex.com
Wed Jun 8 19:58:44 PDT 2005


----- Original Message ----- 
From: "Walter Vaughan" <wvaughan at steelerubber.com>
To: <filepro-list at lists.celestial.com>
Sent: Wednesday, June 08, 2005 5:30 PM
Subject: Re: USER command newbie REVISED


> Brian K. White wrote:
>> ----- Original Message ----- From: "Walter Vaughan"
> <snip Walter blindly trying to use facetPhone callerID from filePro>
>
> Well the solution seems to be good mix of BobS's and BrianW's ideas with 
> guidance from TomP, and of course KenB.
>
> <filePro subroutine>
> user phone = /usr/local/bin/fpcid
> phone = "facetPhone_user_name"
> pn = phone
> msgbox pn
> close phone; end
> </filepro>
>
> <shell script /usr/local/bin/fpcid>
> trap '' 2
> while read person
>   do ssh fpcid_user at facetPhone_server \
>        /usr/facetphone_utapi/bin/fp_cid \
>        -n -s -u $person
> done
> </shell script>
>
> The above seems to work in testing (at least in FreeBSD). I'll post a more 
> complete system (with mapping of unix login names to facetPhone login 
> names) when I have finished (including how to generate rsa keys to 
> eliminate needing interactivity via ssh) in exchange for someone getting 
> John Esak to comp me a version of the "pig".
>
> Integrating filePro into a phone system couldn't get much easier (once you 
> learn how to use the USER command :-o )


Just to clear something up about what's exactly allowed and not.

The script needs to loop, and the prc must remain in sync with the script, 
but the pattern of reads/writes can be anything you want, it doesn't have to 
be 1 write followed by 1 read, repeat...

You can have a script that only outputs so that in processing all you ever 
do is read over and over and never write once:
while : ; do
program that prints one or more lines of output
done

Or you could have something you write to and never read from:
while read stuff ; do
program that does something useful with $stuff but you don't care what it 
prints >/dev/null
done

Or it can be any _repeating_ pattern of input/output:
It can read 3 values and spit out 1 answer, or vice-versa or some irregular 
pattern of read read write read write write write etc..
so long as it loops and does the same pattern over and over, and your 
processing does just the same.

1:1 is just the simplest usage and in truth there is often no reason to do 
it any other way.
But sometimes the external program or tcp service you are talking to can't 
be made to fit in a 1:1 pattern and if so, you should know it's no problem.

Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani



More information about the Filepro-list mailing list