Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Running UNIX Command In Informix 4GL

1,730 views
Skip to first unread message

samru...@gmail.com

unread,
Dec 1, 2006, 5:08:38 AM12/1/06
to
Hi,

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

Marco Greco

unread,
Dec 1, 2006, 5:25:19 AM12/1/06
to samru...@gmail.com, inform...@iiug.org


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

ser...@moredata.pt

unread,
Dec 1, 2006, 6:54:39 AM12/1/06
to Marco Greco, inform...@iiug.org, samru...@gmail.com
Hi,

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
>
>


minnic...@aim.com

unread,
Dec 1, 2006, 10:57:19 AM12/1/06
to inform...@iiug.org
Try using the RUN statement, it's in the 4GL manual online.

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.

0 new messages