From owner-freebsd-bugs@FreeBSD.ORG Tue May 13 18:20:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C82D106568F for ; Tue, 13 May 2008 18:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 78D518FC0C for ; Tue, 13 May 2008 18:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4DIK1u9030779 for ; Tue, 13 May 2008 18:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m4DIK1v4030778; Tue, 13 May 2008 18:20:01 GMT (envelope-from gnats) Resent-Date: Tue, 13 May 2008 18:20:01 GMT Resent-Message-Id: <200805131820.m4DIK1v4030778@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Elias Pipping Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F22B106564A for ; Tue, 13 May 2008 18:15:56 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 1DA5D8FC1B for ; Tue, 13 May 2008 18:15:56 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m4DIEmKv079754 for ; Tue, 13 May 2008 18:14:48 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m4DIEmhL079753; Tue, 13 May 2008 18:14:48 GMT (envelope-from nobody) Message-Id: <200805131814.m4DIEmhL079753@www.freebsd.org> Date: Tue, 13 May 2008 18:14:48 GMT From: Elias Pipping To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/123635: jot handles 'stuttering sequences' and reversed ranges incorrectly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2008 18:20:01 -0000 >Number: 123635 >Category: misc >Synopsis: jot handles 'stuttering sequences' and reversed ranges incorrectly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 13 18:20:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Elias Pipping >Release: current >Organization: >Environment: The tests were run on an intel mac with the /usr.bin/jot code from CVS $ uname -a Darwin mac.local 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar 4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386 i386 >Description: Jot does not seem to be working correctly, with regard to both intuition and to the manpage. I'll use pp.awk to format the output of jot a bit -- you can find the code further down. The manpage suggests: The stuttering sequence 9, 9, 8, 8, 7, etc. can be produced by suitable choice of step size, as in jot - 9 0 -.5 This is what happens: $ jot - 9 0 -.5 | awk -f pp.awk 2 3 4 5 6 7 8 9 0 1 3 1 3 1 3 1 3 1 2 1 Furthermore, while this works: $ jot -r 10000 0 9 | awk -f pp.awk 2 3 4 5 6 7 8 9 0 1 999 977 1008 972 989 1007 1006 1053 1032 957 This should produce basically the same results, but it does not: $ jot -r 10000 9 0 | awk -f pp.awk 9 10 11 12 13 14 15 16 1237 1233 1271 1210 1247 1260 1262 1280 Appendix ======== $ cat pp.awk { freq[$0]++ } END \ { for (entry in freq) printf("%4s ", entry); print(""); for (entry in freq) printf("%4d ", freq[entry]); print(""); } >How-To-Repeat: This script http://page.mi.fu-berlin.de/pipping/jot/test_jot.sh runs a couple of tests with jot fetched from multiple BSDs' CVS repositories. (Tested on Mac OS X only) >Fix: >Release-Note: >Audit-Trail: >Unformatted: