Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Paul Roberts — — source: Informix-list mailing list archive (1991-1998)
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 temp1select a
into string_var
from temp1drop table temp1run "rm /tmp/t1 /tmp/t2"
I have done this kind of thing, and it does work.
Paul
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.