[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #UGN-989544]: ncdump -k fails to add newline to result in later versions
- Subject: [netCDF #UGN-989544]: ncdump -k fails to add newline to result in later versions
- Date: Thu, 06 Dec 2018 19:38:47 -0700
Oh I don't think it is as bad as all that :-)
I use ncdump -k routinely and disambiguating its output
isn't that big a deal, for me at least.
> I feared it was intentional. In any case, a script writer
> can adapt to the newline better than an interactive shell
> prompt user can adapt to the lack thereof. The question
> becomes, is ncdump for interactive use, or is it condemned
> to be just for scripts. -Hoop
>
> P.S.:
>
> The backticks make the newline go away in any case; your
> script fragment still works with the older ncdump that
> prints the newline after the string. So, red herring, that.
>
> On 12/6/18 6:53 PM, Unidata netCDF Support wrote:
> > I think this change was intentional. The idea was that
> > it made it easier to use ncdump -k in scripts to determine
> > the type of a file.
> > e.g.
> > KIND=`ncdump -k $file`
> > if test "x$KIND" = xnetcdf-4 ; then ... else ... fi
> >
> >
> >> In version 4.4.1.1, "ncdump -k file.nc" printed a string ending with a
> >> newline.
> >> In 4.6.1 and 4.6.2, it does not. I compared the source for 4.4.1.1 and
> >> 4.6.2.
> >>
> >> The lines:
> >>
> >> if (kind_out) {
> >> printf ("%s\n", kind_string(formatting_specs.nc_kind));
> >> } else if (kind_out_extended) {
> >> printf ("%s\n",
> >> kind_string_extended(formatting_specs.nc_extended,formatting_specs.nc_mode));
> >> } else {
> >>
> >> became:
> >>
> >> if (kind_out) {
> >> printf ("%s", kind_string(formatting_specs.nc_kind));
> >> } else if (kind_out_extended) {
> >> printf ("%s",
> >> kind_string_extended(formatting_specs.nc_extended,formatting_specs.nc_mode));
> >> } else {
> >>
> >> Diff output looks like:
> >>
> >> 2302c2362
> >> < printf ("%s\n", kind_string(formatting_specs.nc_kind));
> >> ---
> >>> printf ("%s", kind_string(formatting_specs.nc_kind));
> >> 2304c2364
> >> < printf ("%s\n",
> >> kind_string_extended(formatting_specs.nc_extended,formatting_specs.nc_mode));
> >> ---
> >>> printf ("%s",
> >> kind_string_extended(formatting_specs.nc_extended,formatting_specs.nc_mode));
> >>
> >> So, fixing it would be trivial, given the will....
> >>
> >> Thanks,
> >> -Hoop
> >>
> >>
> >
> > =Dennis Heimbigner
> > Unidata
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: UGN-989544
> > Department: Support netCDF
> > Priority: Normal
> > Status: Open
> > ===================
> > NOTE: All email exchanges with Unidata User Support are recorded in the
> > Unidata inquiry tracking system and then made publicly available through
> > the web. If you do not want to have your interactions made available in
> > this way, you must let us know in each email you send to us.
> >
> >
>
>
=Dennis Heimbigner
Unidata
Ticket Details
===================
Ticket ID: UGN-989544
Department: Support netCDF
Priority: Normal
Status: Open
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata
inquiry tracking system and then made publicly available through the web. If
you do not want to have your interactions made available in this way, you must
let us know in each email you send to us.