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

20000605: Using PIPE to compress



Alan,

In your csh invocation below, you are redirecting the standard out
of compress to the file named KEPZ19990715_142435.Z. Redirection
is a shell thing- which is probably your confusion with pqact- though
I don't see the actual pqact.conf entry you are using. Unfortunately
for compress, I don't see a man page entry on how to specify an output
name for the file if the input is coming from standard input.

Several ways to address this-

from a PIPE command in pqact.conf:

WMO     (KEPZ19990715_142435)
        PIPE    -close  compressit.csh \1

where compressit.csh is an executable csh which looks like:
#!/bin/csh -f
# Usage: cat file | compressit.csh outfilename

cat >! $1
compress $1
exit 0

In the above, you should always ensure that the script exists with 0 for
the exit status.

Or, use the FILE pqact.conf action to write the data to disk (with the
-close option), and the EXEC option to compress the file.


Steve Chiswell
Unidata User SUpport

>From: address@hidden
>Organization: UCAR/Unidata
>Keywords: 200006051940.e55Je5T13098

>If I use the cat command and pipe the output to compress it works fine:
>
>cat KEPZ19990715_142435 | compress -cf > KEPZ19990715_142435.Z
>
>But LDM doesn't seem to want to pipe it to compress...Any other
>suggestions?
>
>
>Unidata Support <address@hidden> on 06/05/2000 01:48:07 PM
>                                                              
> To:      Alan Hall/NCDC                                      
>                                                              
> cc:      address@hidden                        
>                                                              
> Subject: 20000605: Using PIPE to compress                    
>
>>From: address@hidden
>>Organization: National Climatic Data Center
>>Keywords: 200006051731.e55HVJT08896 LDM pqact PIPE compress
>
>Alan,
>
>>I am trying to compress files as they come in thru LDM using:
>>
>>EXP  ^(.*)
>>     PIPE -close
>>     compress -cvf - 1>/npdis/noaaport/nexradII/\1.Z
>>
>>The compress shows up as a process, but I never get a .Z file written.
>Can
>>anyone give me any insights?
>
>I would try using:
>
>EXP  ^(.*)
>     PIPE -close
>     compress -cf > /npdis/noaaport/nexradII/\1.Z
>
>This assumes, of course that the user running your LDM has write permission
>in the /npdis/noaaport/nexradII directory.
>
>>Thanks,
>>Alan.
>>        ****** Signature Tag ******
>>        National Climatic Data Center
>
>Tom Yoksas

>From address@hidden Tue Jun  6 07:11:30 2000
>Subject: Re: 20000605: Using PIPE to compress


Thank-you Thank-you...this pointed me in the right direction.  I am trying
to compress and write to a file in one action avoiding a separate file and
separate compress.  I modified your script to look like:

#!/bin/csh -f
compress -cf > $1.Z
exit 0

This works perfectly.

Alan.