Main Board > Language

Windx Linux Shell Commands

(1/2) > >>

Lawrence_Leavell:
In the client/server Windx environment with a Linux server, how are shell scripts executed from a Windx Business basic process?

Devon Austen:
The INVOKE directive allows you to pass a command off to the operating system.

INVOKE "cat my_file | grep 'serach string'"

If you want the send the Windows workstation the command prefix with [wdx] or [lcl]

https://manual.pvxplus.com/?directives/invoke.htm

 

Lawrence_Leavell:
OK, use invoke.  In that case, how do I test the return response from Linux?

Devon Austen:
If you want to read back the result you can use pipe IO instead i.e.

OPEN (chn)"<cat my_file | grep 'serach string'"
read record (chn) result$

You then can keep doing reads until you get an EOF.

You can use INVOKE, but if you want the result you need to redirect it to a file and read the file.

INVOKE "cat my_file | grep 'serach string' > result"
open (chan)"result"
read record (chn) result$

John_S:
We use the EXECUTE command.

48110 LET XX$="A=SYS("+$22$+"/data/DATAMpvx/emailer.pl '"+WHOFM$+"' '"+EMAIL$+"
48110:' '"+ATTACHMENT$+"' '"+SUBJ$+"'"+$22$+")"
48120 EXECUTE XX$

The above invokes a Perl script to send an e-mail. The script returns a 0 or 1 to our variable A, which we can test to see if the mail was sent successfully.

Navigation

[0] Message Index

[#] Next page

Go to full version