Re: how to?
Posted in 1998
ori96@batelco.com.bh wrote: > > Hallo everybody, > I am writing a 4gl program in which I want to pass a value to a shell > script and I am not sure how to do it. From the 4gl code I try to use : > run "myscript" but I want to pass a value from the 4gl to myscript and then > read it from inside the script. You can use a character variable to contain a valid executable command, then simply supply that variable to the RUN command. Something like: DEFINE cmd CHAR(80) : : LET cmd = "myscript ", myparam1, " ", myparam2 RUN cmd Just be very careful of spaces between command and parameters, and between parameters. If you need to send multi-word parameters, then don't forget to enclose them in quotes, like so: LET cmd = "myscript '", myparam1, "' '", myparam2, "'" RUN cmd If you need double quotes, then don't forget to quote them, as follows: LET cmd = "myscript \\"", myparam1, "\\" \\"", myparam2, "\\"" RUN cmd Hope that helps, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com http://www.iiug.org |///// / //| | +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+