[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: Mon, 10 Dec 2018 12:52:19 -0700
Your point about `...` eliding the final newline is relevant.
I will put up an issue for it so we can remember to discuss it.
No promises that we will change it.
> As I said in my P.S. before, the whole business of ease of use in
> scripts is a red herring. Your script fragment works just fine
> with the older ncdump that printed the newline. The backticks
> remove it. I've been writing shell scripts for 37 years; I've
> a notion what I'm on about there. -Hoop
>
> On 12/6/18 7:38 PM, Unidata netCDF Support wrote:
> > 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.
> >
> >
>
>
=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.