NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Is there an easy and quick way to *get* the value of an attribute (whether global or variable) from a (bash) shell commandline or script? AFAICS * NCO's `ncatted` will allow one to *set* an attribute value, but is write-only. * R package=ncdf4 will allow one to get an attribute value, but requires loading R, plus writing a fair bit of code. Am I missing something? Currently, unless I need to run R for other reasons, I'm writing bash like if [[ "$(ncdump -h ${F} | fgrep -e ${OUTPUT_VAR_NAME}:units)" =~ "${OUTPUT_VAR_UNITS}" ]] ; then echo -e 'output!' fi which is not as robust as I'd like. TIA, Tom Roche <Tom_Roche@xxxxxxxxx>
netcdfgroup
archives: