aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDiomidis Spinellis <dds@FreeBSD.org>2006-11-06 15:11:50 +0000
committerDiomidis Spinellis <dds@FreeBSD.org>2006-11-06 15:11:50 +0000
commit7d71f06cb47227f16ac20155c202725aa2b3d9b2 (patch)
treebda309685456bbe12ea67a0fac550092564989fd /usr.bin
parent850cb5f8db735449da75f53a3536d150ac82a4cf (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/jot/jot.16
-rw-r--r--usr.bin/jot/jot.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/jot/jot.1 b/usr.bin/jot/jot.1
index 1aa0d623bb32..77cebb403a5a 100644
--- a/usr.bin/jot/jot.1
+++ b/usr.bin/jot/jot.1
@@ -115,7 +115,7 @@ conflict, the lower value is used.
If fewer than three are specified, defaults are assigned
left to right, except for
.Ar s ,
-which assumes its default unless both
+which assumes a default of 1 or -1 if both
.Ar begin
and
.Ar end
@@ -171,6 +171,10 @@ a function in APL.
.Ex -std
.Sh EXAMPLES
The command
+.Dl jot - 1 10
+.Pp
+prints the integers from 1 to 10,
+while the command
.Dl jot 21 -1 1.00
.Pp
prints 21 evenly spaced numbers increasing from -1 to 1.
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c
index d7f700c2c2e5..f403bcc5518a 100644
--- a/usr.bin/jot/jot.c
+++ b/usr.bin/jot/jot.c
@@ -193,10 +193,13 @@ main(int argc, char **argv)
case HAVE_ENDER | HAVE_STEP:
case HAVE_BEGIN:
case HAVE_BEGIN | HAVE_STEP:
- case HAVE_BEGIN | HAVE_ENDER:
reps = REPS_DEF;
mask |= HAVE_REPS;
break;
+ case HAVE_BEGIN | HAVE_ENDER:
+ s = ender > begin ? 1 : -1;
+ mask |= HAVE_STEP;
+ break;
case HAVE_BEGIN | HAVE_ENDER | HAVE_STEP:
if (randomize)
reps = REPS_DEF;