[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20050504: LDM: PIPE-ing to scripts (was: Binaries available?)



Scott,

>Date: Wed, 04 May 2005 08:11:34 -0800
>From: "Scott Swank" <address@hidden>
>Organization: NOAA/NWS
>To: Steve Emmerson <address@hidden>
>Subject: Re: 20050504: LDM - Binaries available?
>Keywords: 200504291922.j3TJMbKx001883

The above message contained the following:

> I guess I'm missing something here.  How do I read the product from 
> standard input when it is in the queue? Don't I have to extract it to 
> write it?

The PIPE action causes the pqact(1) process to 1) spawn a child process
whose standard-input stream is connected to a UNIX pipe; and 2) write
the selected data-product to the pipe (the "-close" option will,
subsequently, cause the pqact(1) process to then close the pipe).
Consequently, any decoder invoked via the PIPE action will see the
data-product in question on its standard-input stream.

> A small script snippit would be great to give me something to go by.

The simple decoder script

    cat > $1

would be compatible with the following PIPE entry:

    EXP ^(METAR.*)      PIPE    -close  /apps/datatools/simpleDecoder data/\1

and would create files with names like

    data/METAR_vrh_SAUS20KNKA.86263.123215455

Of course, for such a simple decoding process, the FILE action would
actually be more efficient.

Information on version 6.3.0 of the pqact(1) configuration-file can be 
found at

    
http://my.unidata.ucar.edu/content/software/ldm/ldm-6.3.0/basics/pqact.conf.html

Regards,
Steve Emmerson