system command
Brian K. White
brian at aljex.com
Mon Oct 31 23:46:05 PST 2005
----- Original Message -----
From: "Dennis Malen" <dmalen at malen.com>
To: "Fairlight" <fairlite at fairlite.com>; <filepro-list at lists.celestial.com>
Cc: "pmahler" <pmahler at malen.com>
Sent: Monday, October 31, 2005 5:36 PM
Subject: Re: system command
> Mark,
>
> Thanks for your response.
>
> Is the problem really the echo command? When I apply that line directly to
> a command line with the use of "echo" in unix it works fine. For your
> information this is a string that executes a TinyTerm file which brings
> over the record number that the user resides in to windows where the
> scanned images reside and pulls up the appropriate record in windows to
> view the scanned images attached to the subject record number.
>
> When executed from the command line it works fine, when executed from the
> system command it does nothing. In addition I have verified that the code
> used in the system command provides visually the correct code with the use
> of msgbox. It displays the code correctly but does not take the user to
> windows via TinyTerm executable file ".cs".
The problem is probably that your interactive shell differs from that fp
uses in a system command.
Or more exactly, the echo command.
I think fp just does a system() which ends up running ?? who knows what
shell on your box.
when you are at your command line, it might not be the same shell. Or even
if they are the same shell, your interactive one may have it's behaviour
changed by settings in startup files like .profile .<yourshell>rc
/etc/profile /etc/<yourshell>rc etc..
The echo commands might not behave the same in the two shells.
Test empirically. make a system command that says system "echo $0; read
junk"
when you run it it will show something like "/bin/sh" and wait for you to
press enter.
do the same echo $0 (no read junk needed here) at your command line.
If they are the same, then look into possible effects caused by settings in
your profiles & *shrc files.
Or you can remove the guesswork of hoping the right shell and it's "echo"
and it's settings & environment will always just happen to be right, and use
/bin/echo in place of echo.
/bin/echo is a stand-alone binary and should not be effected by what shell
is in effect when it gets run, nor echo-behaviour-modifying settings that
may have or have not been set in that shell at that time.
find the man-page for the stand-alone /bin/echo and figure out the correct
syntax for that, which might be slightly different from the shell built-in
echo.
Things like, the stand-alone might need an extra leading 0 in \0015, or it
might require no leading 0, \15 , etc... The stand-alone might require a -e
and/or -n options or none, or something else...
like system "/bin/echo -e \"\033.....\015\""
The noredraw doesn't matter.
Also, for you, there is probably a simpler and better way available anyways.
You should be able to use a show or show raw command in place of system
echo, but I use shell scripts for this myself so that they can automagically
figure out which of several similar sequences should be used that do the
same job on different emulator programs. TUN, Anzio, FacetWin, Anita... and
I use the same scripts outside of fp, So because of that, I always end up
using echo too and don't think I ever even tried the more efficient, pure fp
approach of using show raw. Your command seems like there is no possible
equivalent in any other emulator, so you have nothing to lose by hard coding
a tiny term sequence right in the fp code, so you might as well try show
raw.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
>
> Dennis Malen
> 516.479.5912
> ----- Original Message -----
> From: "Fairlight" <fairlite at fairlite.com>
> To: <filepro-list at lists.celestial.com>
> Sent: Monday, October 31, 2005 4:45 PM
> Subject: Re: system command
>
>
>> In the relative spacial/temporal region of
>> Mon, Oct 31, 2005 at 03:43:25PM -0500, Dennis Malen achieved the
>> spontaneous
>> generation of the following:
>>> I would like to place the following string in a system command:
>>>
>>> echo "\033&oFvar searchnum=55555;CompileFile(\"260268.cs\");\015"
>>>
>>> When this line is executed on the command line it works perfectly. The
>>> following is my processing for "system":
>>>
>>> Then:le="echo";lg="\"\\033&o";pa="Fvar
>>> searchnum="{@rn{";CompileFile(\\\"260268.cs\\\");\\015\""
>>>
>>> Then: system le<lg{pa
>>>
>>> If I use "msgbox le<lg{pa" the line comes up in the window correctly. If
>>> I
>>> cut and paste the line to the unix command line it executes properly.
>>> The
>>> system command does not execute it properly. In fact, nothing happens.
>>> In
>>> lieu of using "\" to put in the extra "\" and quotes I experimented with
>>> using "chr". That also displayed on the message box correctly, but when
>>> used
>>> with the system command nothing happened.
>>>
>>> Also please note that "55555" that I hard wired in was properly
>>> substituted
>>> for the "@rn" in the string and displays correctly.
>>>
>>> If it works on the command line, it should work in the system command.
>>>
>>> Any help would be appreciated.
>>
>>
>> However, look at your command. It's an echo. It's not being redirected
>> to anywhere. Near as I can tell at a glance, your code should result in
>> a
>> command of:
>>
>> echo "\033&oFvar searchnum=55555;CompileFile("260268.cs");\015
>>
>> Which may be all fine and well. But where are you capturing it? You say
>> nothing happens, but all you have is an echo with no redirection, piping,
>> etc.
>>
>> What basically happens is that it probably echoes to the screen, but then
>> the screen is immediately redrawn and you don't see it. Try using
>> "system
>> noredraw" and see if it appears onscreen.
>>
>> Better yet, try appending ">/tmp/debug_echo" and see if that file
>> actually
>> appears and has the right contents. I can't say more about what's
>> failing
>> or not without knowing the context in which you're attempting to use this
>> code. I suspect it's working but not visible.
>>
>> mark->
>> --
>> There is no "I" in TEAM.
>> This would be the primary reason I've chosen not to join one.
>> _______________________________________________
>> Filepro-list mailing list
>> Filepro-list at lists.celestial.com
>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>>
>>
>>
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
More information about the Filepro-list
mailing list