home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!gossip.pyramid.com!pyramid!infmx!proberts
- From: proberts@informix.com (Paul Roberts)
- Newsgroups: comp.databases.informix
- Subject: Re: Catching output from RUN command (4GL)
- Message-ID: <1993Jan24.222617.19612@informix.com>
- Date: 24 Jan 93 22:26:17 GMT
- References: <C1D1pp.AA0@dircon.co.uk>
- Sender: news@informix.com (Usenet News)
- Organization: Informix Software, Inc.
- Lines: 36
-
- In article <C1D1pp.AA0@dircon.co.uk> uaa1006@dircon.co.uk (Peter Miles) writes:
- >
- >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!
-
- You can always do something (kind of klugey!) like this :
-
- run "tail -1 /tmp/somefile > /tmp/t1"
- run "paste -d'|' /tmp/t1 /dev/null > /tmp/t2"
-
- ### (i.e. stick a "|" onto the end of your one-line file)
-
- create temp table temp1 ( a char(80) )
-
- load from "/tmp/t2" insert into temp1
-
- select a
- into string_var
- from temp1
-
- drop table temp1
- run "rm /tmp/t1 /tmp/t2"
-
- I have done this kind of thing, and it does work.
-
- Paul
-