tech-userlevel archive

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

Re: jot: producing too much output?



    Date:        Thu, 5 Jan 2023 09:52:06 -0500 (EST)
    From:        Mouse <mouse%Rodents-Montreal.ORG@localhost>
    Message-ID:  <202301051452.JAA23698%Stone.Rodents-Montreal.ORG@localhost>

  | jot -s "" - 32 126
  |
  | Based on reading the manpage, I would expect that to produce a single
  | line 323334353637...124125126.  It does on my 1.4T.  On my 5.2,
  | ftp.n.o's 9.0_STABLE, and a work 9.1 machine, the line actually ends
  | ...125126127128129130131.

The man page actually says:

     If fewer than three [of the reps begin end & step args] are specified,
     defaults are assigned left to right, except for s, which assumes its
     default unless both begin and end are given.

What actually happens, is that if only 2 args are given, unless one of them
is reps (and the other is begin or end) the only arg actually used is begin,
a default is assigned (left to right...) for reps, so the default (100) reps
is used (just like a simple "jot") - in your case that's 100 values,
from 32 .. 131.

Whether something different should be done when begin and end are given
(but neither reps nor step, so one would need to guess, at least one of
those) I don't know.

kre



Home | Main Index | Thread Index | Old Index