unix command through speedscript

sanjaynayaka

New Member
hi i executed following speedscript code in my linux server machine
<script language="speedscript">
IF OPSYS = "UNIX" THEN UNIX ls.
ELSE IF OPSYS = "WIN32" THEN DOS dir.
ELSE DISPLAY OPSYS "is an unsupported operating system".
</script>

i did not get any output on my screen. it was expected to display all the files in the current directory in my linux machine.
 
Using WebSpeed the stdout/stderror is redirected in a log file named
[yourwebspeedbrokername].server.log, the file is on the server side.
To display something in the HTML page use {&OUT}

**Note: better is to use WebTools for this:
http://host:port/cgi-bin/wspd_cgi.sh/WService=YourWSBrokerName/ping
http://host:port/cgi-bin/wspd_cgi.sh/WService=YourWSBrokerName/workshop

... and another better ideea is to post your question to the WebSpeed section, this
can "touch" WebSpeed developers.

try... this is 4GL and compatible UNIX/WIN32.

DEFINE VARIABLE lcLine AS CHARACTER NO-UNDO.
DEFINE STREAM ls.
INPUT STREAM ls FROM OS-DIR("/home/rares/tmp").
REPEAT:
IMPORT STREAM ls UNFORMATTED lcLine.
IF ENTRY(3,lcLine," ") = "F" THEN DO:
lcLine = REPLACE(ENTRY(2,lcLine," "),'"','').
{&OUT} lcLine '<br>' SKIP.
END.
END.
INPUT STREAM ls CLOSE.
 
Back
Top