I would like to know that how we can run a UNIX commands and capture
there return values in Informix 4GL.
Suppose I want File comparision command like cmp to check in 4GL &
capture a result which is 0 means both are equal in some variable , how
would i do this?
Else, the UNIX Command which returns last line of file & i would like
to capture/save this line in Informix Variable.
Please give me solution.
Thanks
Samruddhi
have a look at fglio.sh.Z (another quality product from yours truly) at the
IIUG software archives
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Use the RETURNING of the RUN statement.
Bellow you have an example that works.
--------------------------
MAIN
DEFINE retVal INTEGER
DEFINE keyword CHAR(20)
DEFINE command CHAR(40)
LET keyword = arg_val(1)
LET command = "grep ", keyword clipped, " *"
RUN command RETURNING retVal
IF retVal = 0 THEN
DISPLAY "Keyowrd ", keyword clipped, " exist on some file "
ELSE
DISPLAY "Keyowrd ", keyword clipped, " does not exist on some file "
END IF
END MAIN
--------------------------
Sérgio
> have a look at fglio.sh.Z (another quality product from yours truly) at
> the
> IIUG software archives
>
>
> --
> Ciao,
> Marco
> ______________________________________________________________________________
> Marco Greco /UK /IBM Standard disclaimers
> apply!
>
> Structured Query Scripting Language
> http://www.4glworks.com/sqsl.htm
> 4glworks
> http://www.4glworks.com
> Informix on Linux
> http://www.4glworks.com/ifmxlinux.htm
>
> _______________________________________________
> Informix-list mailing list
> Inform...@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
>
i.e. run "ls -l /etc" returning rc
Good luck,
Brian
>I would like to know that how we can run a UNIX commands and capture
>there return values in Informix 4GL.
_______________________________________________
________________________________________________________________________
Check Out the new free AIM(R) Mail -- 2 GB of storage and
industry-leading spam and email virus protection.