Search Box

Google

Saturday, December 09, 2006

Running UNIX Command In Informix 4GL
All 4 messages in topic - view as tree
From: samrudd...@gmail.com - view profile
Date: Fri, Dec 1 2006 12:08 pm
Email: samrudd...@gmail.com


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


Reply » Rate this post:


From: Marco Greco - view profile
Date: Fri, Dec 1 2006 12:25 pm
Email: Marco Greco




- Hide quoted text -
- Show quoted text -

samrudd...@gmail.com wrote:
> 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



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


Reply » Rate this post: Text for clearing space


From: ser...@moredata.pt - view profile
Date: Fri, Dec 1 2006 1:54 pm
Email: ser...@moredata.pt

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



- Hide quoted text -
- Show quoted text -

> samrudd...@gmail.com wrote:
>> 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


> 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
> Informix-l...@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list



Reply » Rate this post: Text for clearing space


From: minnickbr...@aim.com - view profile
Date: Fri, Dec 1 2006 5:57 pm
Email: minnickbr...@aim.com


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.


Reply » Rate this post: Text for clearing space


End of messages

No comments: