Re: Passing argument to shell script from 4GL
Posted in 1998
The correct syntax to use is: run "ls -l" returning errorcode (Substitute your shell script and return variable as appropriate.) The limitation is that Informix can only handle the values 0-255 as a return error code from any shell/executable run via the run command. If you really need to read a value greater/less than these limits, or if you need to return a string/date/decimal/etc. value, you have a couple of options. You can write a c function as Art suggested or you can write the output of the shell script to a Unix file and read it using fgl_getrec and fgl_getret. These functions are somewhere in the $INFORMIXDIR/demo directories in example programs. They are somewhat kludgy and extremely slow compared to a c function, but they do work. Art S. Kagel wrote: > pkedar@my-dejanews.com wrote: > > > > Hi all, > > > > I want to call a shell script from 4gl with argument and get return value in > > 4gl variable!! > > > > Is it possible? > > No, not directly. You could write a "C" program to do it directly or > to read the shell scripts results from some file it wrote to. > > Art S. Kagel