On Tue, Jun 3, 2008 at 2:42 AM, Davies <davies.liu> wrote:> how to read data from stdin in q scripts ?what a coincidence, i just found out about this last week :)do a text read from fd 0#!/usr/bin/env qdata:read0 0…-- Aaron Daviesaaron.davies@gmail.com</davies.liu>
On Tue, Jun 3, 2008 at 8:19 PM, Aaron Davies <aaron.davies> wrote:> On Tue, Jun 3, 2008 at 2:42 AM, Davies <davies.liu> wrote:>>> how to read data from stdin in q scripts ?>> what a coincidence, i just found out about this last week :)>> do a text read from fd 0>> #!/usr/bin/env q> data:read0 0> …oh, one other thing–read0 is unstable on long input, possibly limitedto 1000 bytes. the preferred way to do it is to implement the inputand close hooks. to echo your input (i’m doing this “blind” (w/otesting) so it may not work exactly as typed):#!/usr/bin/env q.z.pi:{data set
vs x}.z.pc:{-1 data;}-- Aaron Daviesaaron.davies@gmail.com</davies.liu></aaron.davies>