passing a variable in filePro to the OS (SCO v 6) for use, RE: passing a variable in filePro to the OS (SCO v 6) for use,
John Esak
john at valar.com
Mon Oct 11 11:46:20 PDT 2010
> That makes sense! Thanks!
>
> But I'm still not sure if this will work the way I need.
>
> All I need to do is execute the following "system" command.
> So whether I
> execute it outright from the "system" command and a variable,
> or set an
> environment variable as you suggest below, the syntax still
> needs to work.
>
> Here is what I tried:
>
> system "chmod 777 /u/appl/fpmerge/faxstate.prn3";
> system "chmod 777
> /u/appl/fpmerge/SEND"
>
> system "tail +PC /u/appl/fpmerge/faxstate.prn3 >
> /u/appl/fpmerge/SEND"
> where PC is a variable set in processing that
> is never ZERO,
> and represents the number of lines of difference between the
> actual FAX file
> and 60 lines, the printer default.
>
Okay, disregarding for the moment why your attempts didn't work. Yes, you
could go to the trouble of using PUTENV to place a variable and its current
value into your envirnoment... And then use a system call to make use of
that variable... But a better thing to try would be using the varible as it
is in filepro to construct your system command and then use that. And you
may also bendefit from something I tell everyone who asks about SYSTEM
commands. Do not do it all on one line with the system command. It is much
easier and more useful to build a variable, and then do:
system variable
In other words. You might do something like this:
declare SysCmd
SysCmd="tail" < "-p" { PC < myfilename { ""
I always squish a null onto the end of every assignment I make. Don't ask
me why, or I'll want you to buy my bookds....:-).. After building this
variable, you run the system command as
system SysCmd
Why is this more helpful? Because if things don't go right, you can use
filePro to help you debug the problem. Yo might do
mesgbox SysCmd
Just to show you what the system command is going to look like. Perhaps,
you'll notice you left off a quotes or missd a ; or whatever. Also you
can build really long commands by doing something like:
SysCmd="a huge long set of commdnds; after; command; after commdn" { ""
And then do:
sysCmd=SysCmd < "some more stuf; and some more stuff" { ""
Then finally you run:
system SysCmd
And you are running a whole lot of things, or a command that is much to long
to fit on the "then" line in filePro's cabe program.
Good luck,
John
P.S. - Acutally, I see that you are wanting to tail the exact number of
lines of a text file. Good, there are times when this is exactly what is
wanted. Just want you to be aware that you could also do a similar thing
with the "less" program. In other words it would startthem off at the right
line in the file, but they would have the abilities of the powerful "less"
reader to let them navigate all around the document and then leave it .
I understand that this might not apply in this project, just throwing out a
tip.
By the way please note that I stupidly used the word PUTVAR in my first
note instead of PUTENV which of course, it is supposed to be. Sorry ofr any
inconvenience this may have causd you.
More information about the Filepro-list
mailing list