Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: [ldm-users] understanding the PIPE action

Hi Jeff,

On Sun, 7 Jun 2009, Jeffrey Lake - Admin wrote:

I am attempting to get a hold of the PIPE action in LDM.
here is what I have as a test in my pqact.conf
------------------------------------------
#TEST
DDPLUS[tab] ^.*/pSVR
[tab]PIPE[tab]decoders/test.sh
-----------------------------------------
and the test.sh script
----------------------------------------------
#!/bin/sh
php /usr/local/ldm/decoders/test.php "$1"
----------------------------------------------

LDM pipes the product over STDIN for the script and works much like how the UNIX pipe command (|) works. You can test this outside of LDM by simply doing so:

cat SVR.txt | php test.php SVR

I have never read stdin with PHP, so perhaps you can use your shell script wrapper to help out.

#!/bin/sh

# Place STDIN into this file
cat > /tmp/tmpfile.$$
php /usr/local/ldm/decoders/test.php "$1" "/tmp/tmpfile.$$"

daryl

--
/**
 * Daryl Herzmann
 * Assistant Scientist -- Iowa Environmental Mesonet
 * http://mesonet.agron.iastate.edu
 */


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690