[gradsusr] Use wgrib2 to check if grib2 file is valid

Ivan Toman ivtoman at inet.hr
Wed Oct 12 17:48:07 EDT 2016


Hello Jeff,

I do compare file sizes currently, but as they change little bit, it is 
still not too robust. I'm trying to find fail proof solution.

So as I said, I can't capture response from wgrib2 into variable for 
some reason. See these two examples:

Example 1) Capturing date output to variable:
$ response=`date`
$ echo $response
Wed Oct 12 20:50:46 UTC 2016

Works just fine.


Wgrib2 error:
wgrib2 -v 2016101212.gfs.t12z.pgrb2f001 | grep ERROR

*** FATAL ERROR: rd_grib2_msg_seq_file, read outside of file, bad grib 
file ***


Example 2) Trying to capture ERROR from wgrib2:
$ response=`wgrib2 -v 2016101212.gfs.t12z.pgrb2f001 | grep ERROR`

*** FATAL ERROR: rd_grib2_msg_seq_file, read outside of file, bad grib 
file ***
$ echo $response


Nothing is returned. Empty variable. That is what I try to fix..

Thank you,
Ivan Toman



More information about the gradsusr mailing list