home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!news.Brown.EDU!qt.cs.utexas.edu!yale.edu!newsserver.jvnc.net!darwin.sura.net!europa.asd.contel.com!emory!emory!not-for-mail
- From: alan@effluvia.den.mmc.com (Alan Popiel)
- Newsgroups: comp.databases.informix
- Subject: Re: Catching output from RUN command (4GL)
- Date: 25 Jan 1993 11:18:06 -0500
- Organization: Mailing List Gateway
- Lines: 53
- Sender: walt@mathcs.emory.edu
- Distribution: world
- Message-ID: <1k13ruINNros@emory.mathcs.emory.edu>
- Reply-To: alan@effluvia.den.mmc.com (Alan Popiel)
- NNTP-Posting-Host: emory.mathcs.emory.edu
- X-Informix-List-ID: <list.1818>
-
- ->From: uaa1006@dircon.co.uk (Peter Miles)
- ->Subject: Catching output from RUN command (4GL)
- ->Date: Sun, 24 Jan 1993 13:34:36 GMT
- ->Reply-To: uaa1006@dircon.co.uk (Peter Miles)
- ->
- ->Does anyone know if there is any way of capturing the output
- ->of a command run by the 4GL RUN command into an Informix 4GL
- ->variable?
- ->
- ->EG I want to say something like:
- ->
- ->LET string=RUN "tail -1 /tmp/somefile"
- ->
- ->The output I want to catch will always be only one line long.
- ->I'm running i4gl version 4 (standard engine).
- ->
- ->Comments and suggestions gratefully received!
- ->
- ->Please Email me, as my newsfeed seems to be a bit shakey at
- ->the moment.
- ->
- ->Thank you!
- -> -- Pete
- ->--
- ->Pete Miles uaa1006@dircon.co.uk
- -> ...uknet!dircon!uaa1006
-
- Pete,
-
- Your best bet seems to be writing a C subroutine that:
- 1. runs your command,
- 2. picks up the result,
- 3. returns the result as its function value.
-
- Here at Martin, we did something similar for 'sum' rather than 'tail', to
- test checksums on files being copied across our coast-to-coast net. (This
- code is available on request.)
-
- If you are using the interpreted (RDS) version of i4gl, then you will need
- to rebuild your runner to include the new subroutine. If you are using the
- compiled version, just include the compiled subroutine in the list of .o
- files to be linked. More info on this is in section 1 of volume 1 of the
- 4GL reference manual.
-
- Regards,
- Alan
- +------------------------------+---------------------------------------+
- | R. Alan Popiel | Internet: alan@den.mmc.com |
- | Martin Marietta, LSC | ( Please note: My opinions do not ) |
- | P.O. Box 179, M/S 5422 | ( represent official Martin policy. ) |
- | Denver, Colorado 80201-0179 | Voice: 303-977-9998 |
- +------------------------------+---------------------------------------+
-
-