19b50d902SRodney W. Grimes.\" Copyright (c) 1993 29b50d902SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 39b50d902SRodney W. Grimes.\" 49b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 59b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions 69b50d902SRodney W. Grimes.\" are met: 79b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 89b50d902SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 99b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 109b50d902SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 119b50d902SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 129b50d902SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software 139b50d902SRodney W. Grimes.\" must display the following acknowledgement: 149b50d902SRodney W. Grimes.\" This product includes software developed by the University of 159b50d902SRodney W. Grimes.\" California, Berkeley and its contributors. 169b50d902SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors 179b50d902SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 189b50d902SRodney W. Grimes.\" without specific prior written permission. 199b50d902SRodney W. Grimes.\" 209b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 219b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 229b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 239b50d902SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 249b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 259b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 269b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 279b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 289b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 299b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 309b50d902SRodney W. Grimes.\" SUCH DAMAGE. 319b50d902SRodney W. Grimes.\" 329b50d902SRodney W. Grimes.\" @(#)jot.1 8.1 (Berkeley) 6/6/93 33c3aac50fSPeter Wemm.\" $FreeBSD$ 349b50d902SRodney W. Grimes.\" 35d129c68aSDiomidis Spinellis.Dd November 6, 2006 36d078aa13SPhilippe Charnier.Dt JOT 1 37d078aa13SPhilippe Charnier.Os 38d078aa13SPhilippe Charnier.Sh NAME 39d078aa13SPhilippe Charnier.Nm jot 40d078aa13SPhilippe Charnier.Nd print sequential or random data 41d078aa13SPhilippe Charnier.Sh SYNOPSIS 428fe908efSRuslan Ermilov.Nm 43d078aa13SPhilippe Charnier.Op Fl cnr 44d078aa13SPhilippe Charnier.Op Fl b Ar word 45d078aa13SPhilippe Charnier.Op Fl w Ar word 46d078aa13SPhilippe Charnier.Op Fl s Ar string 47d078aa13SPhilippe Charnier.Op Fl p Ar precision 48ff9a78c0SRuslan Ermilov.Op Ar reps Op Ar begin Op Ar end Op Ar s 49d078aa13SPhilippe Charnier.Sh DESCRIPTION 50e8937ba0SPhilippe CharnierThe 51e8937ba0SPhilippe Charnier.Nm 52e8937ba0SPhilippe Charnierutility is used to print out increasing, decreasing, random, 539b50d902SRodney W. Grimesor redundant data, usually numbers, one per line. 54d078aa13SPhilippe Charnier.Pp 55d078aa13SPhilippe CharnierThe following options are available: 56d078aa13SPhilippe Charnier.Bl -tag -width indent 57d078aa13SPhilippe Charnier.It Fl r 5886fb9103SSteve PriceGenerate random data instead of the default sequential data. 59d078aa13SPhilippe Charnier.It Fl b Ar word 609b50d902SRodney W. GrimesJust print 61d078aa13SPhilippe Charnier.Ar word 629b50d902SRodney W. Grimesrepetitively. 63d078aa13SPhilippe Charnier.It Fl w Ar word 649b50d902SRodney W. GrimesPrint 65d078aa13SPhilippe Charnier.Ar word 669b50d902SRodney W. Grimeswith the generated data appended to it. 67d078aa13SPhilippe CharnierOctal, hexadecimal, exponential, 68d078aa13SPhilippe Charnier.Tn ASCII , 69d078aa13SPhilippe Charnierzero padded, 709b50d902SRodney W. Grimesand right-adjusted representations 719b50d902SRodney W. Grimesare possible by using the appropriate 72d078aa13SPhilippe Charnier.Xr printf 3 739b50d902SRodney W. Grimesconversion specification inside 74d078aa13SPhilippe Charnier.Ar word , 759b50d902SRodney W. Grimesin which case the data are inserted rather than appended. 76d078aa13SPhilippe Charnier.It Fl c 77d078aa13SPhilippe CharnierThis is an abbreviation for 78d078aa13SPhilippe Charnier.Fl w Ar %c . 79d078aa13SPhilippe Charnier.It Fl s Ar string 809b50d902SRodney W. GrimesPrint data separated by 81d078aa13SPhilippe Charnier.Ar string . 829b50d902SRodney W. GrimesNormally, newlines separate data. 83d078aa13SPhilippe Charnier.It Fl n 849b50d902SRodney W. GrimesDo not print the final newline normally appended to the output. 85d078aa13SPhilippe Charnier.It Fl p Ar precision 869b50d902SRodney W. GrimesPrint only as many digits or characters of the data 879b50d902SRodney W. Grimesas indicated by the integer 88d078aa13SPhilippe Charnier.Ar precision . 899b50d902SRodney W. GrimesIn the absence of 90d078aa13SPhilippe Charnier.Fl p , 919b50d902SRodney W. Grimesthe precision is the greater of the precisions of 92d078aa13SPhilippe Charnier.Ar begin 939b50d902SRodney W. Grimesand 94d078aa13SPhilippe Charnier.Ar end . 959b50d902SRodney W. GrimesThe 96d078aa13SPhilippe Charnier.Fl p 979b50d902SRodney W. Grimesoption is overridden by whatever appears in a 98d078aa13SPhilippe Charnier.Xr printf 3 999b50d902SRodney W. Grimesconversion following 100d078aa13SPhilippe Charnier.Fl w . 101d078aa13SPhilippe Charnier.El 102d078aa13SPhilippe Charnier.Pp 1039b50d902SRodney W. GrimesThe last four arguments indicate, respectively, 1049b50d902SRodney W. Grimesthe number of data, the lower bound, the upper bound, 1059b50d902SRodney W. Grimesand the step size or, for random data, the seed. 1069b50d902SRodney W. GrimesWhile at least one of them must appear, 1079b50d902SRodney W. Grimesany of the other three may be omitted, and 1089b50d902SRodney W. Grimeswill be considered as such if given as 109fee14f30SDiomidis Spinellis.Fl "" 110fee14f30SDiomidis Spinellisor as an empty string. 1119b50d902SRodney W. GrimesAny three of these arguments determines the fourth. 1129b50d902SRodney W. GrimesIf four are specified and the given and computed values of 113d078aa13SPhilippe Charnier.Ar reps 1149b50d902SRodney W. Grimesconflict, the lower value is used. 1159b50d902SRodney W. GrimesIf fewer than three are specified, defaults are assigned 1169b50d902SRodney W. Grimesleft to right, except for 117d078aa13SPhilippe Charnier.Ar s , 1187d71f06cSDiomidis Spinelliswhich assumes a default of 1 or -1 if both 119d078aa13SPhilippe Charnier.Ar begin 1209b50d902SRodney W. Grimesand 121d078aa13SPhilippe Charnier.Ar end 1229b50d902SRodney W. Grimesare given. 123d078aa13SPhilippe Charnier.Pp 1249b50d902SRodney W. GrimesDefaults for the four arguments are, respectively, 1259b50d902SRodney W. Grimes100, 1, 100, and 1, except that when random data are requested, 12686fb9103SSteve Pricethe seed, 12786fb9103SSteve Price.Ar s , 12886fb9103SSteve Priceis picked randomly. 129ff9a78c0SRuslan ErmilovThe 130ff9a78c0SRuslan Ermilov.Ar reps 131ff9a78c0SRuslan Ermilovargument is expected to be an unsigned integer, 1329b50d902SRodney W. Grimesand if given as zero is taken to be infinite. 133ff9a78c0SRuslan ErmilovThe 134ff9a78c0SRuslan Ermilov.Ar begin 1359b50d902SRodney W. Grimesand 136d078aa13SPhilippe Charnier.Ar end 137ff9a78c0SRuslan Ermilovarguments may be given as real numbers or as characters 138d078aa13SPhilippe Charnierrepresenting the corresponding value in 139d078aa13SPhilippe Charnier.Tn ASCII . 1409b50d902SRodney W. GrimesThe last argument must be a real number. 141d078aa13SPhilippe Charnier.Pp 1429b50d902SRodney W. GrimesRandom numbers are obtained through 143a26a6612SDiomidis Spinellis.Xr arc4random 3 144a26a6612SDiomidis Spinelliswhen no seed is specified, 145a26a6612SDiomidis Spinellisand through 146a26a6612SDiomidis Spinellis.Xr random 3 147a26a6612SDiomidis Spinelliswhen a seed is given. 148d129c68aSDiomidis SpinellisWhen 149d129c68aSDiomidis Spinellis.Nm 150d129c68aSDiomidis Spinellisis asked to generate random integers or characters with begin 151d129c68aSDiomidis Spinellisand end values in the range of the random number generator function 152d129c68aSDiomidis Spinellisand no format is specified with one of the 153d129c68aSDiomidis Spinellis.Fl w , 154d129c68aSDiomidis Spinellis.Fl b , 155d129c68aSDiomidis Spinellisor 156d129c68aSDiomidis Spinellis.Fl p 157d129c68aSDiomidis Spinellisoptions, 158d129c68aSDiomidis Spinellis.Nm 159d129c68aSDiomidis Spinelliswill arrange for all the values in the range to appear in the output 160d129c68aSDiomidis Spinelliswith an equal probability. 161d129c68aSDiomidis SpinellisIn all other cases be careful to ensure that the output format's 162d129c68aSDiomidis Spinellisrounding or truncation will not skew the distribution of output 163d129c68aSDiomidis Spinellisvalues in an unintended way. 164d129c68aSDiomidis Spinellis.Pp 1659b50d902SRodney W. GrimesThe name 166d078aa13SPhilippe Charnier.Nm 1679b50d902SRodney W. Grimesderives in part from 168d078aa13SPhilippe Charnier.Nm iota , 1699b50d902SRodney W. Grimesa function in APL. 1706c7216dfSRuslan Ermilov.Sh EXIT STATUS 1716c7216dfSRuslan Ermilov.Ex -std 172d078aa13SPhilippe Charnier.Sh EXAMPLES 1739b50d902SRodney W. GrimesThe command 1747d71f06cSDiomidis Spinellis.Dl jot - 1 10 1757d71f06cSDiomidis Spinellis.Pp 1767d71f06cSDiomidis Spinellisprints the integers from 1 to 10, 1777d71f06cSDiomidis Spinelliswhile the command 178d078aa13SPhilippe Charnier.Dl jot 21 -1 1.00 179d078aa13SPhilippe Charnier.Pp 180d078aa13SPhilippe Charnierprints 21 evenly spaced numbers increasing from -1 to 1. 181d078aa13SPhilippe CharnierThe 182d078aa13SPhilippe Charnier.Tn ASCII 183d078aa13SPhilippe Charniercharacter set is generated with 184d078aa13SPhilippe Charnier.Dl jot -c 128 0 185d078aa13SPhilippe Charnier.Pp 1869b50d902SRodney W. Grimesand the strings xaa through xaz with 187d078aa13SPhilippe Charnier.Dl jot -w xa%c 26 a 188d078aa13SPhilippe Charnier.Pp 1899b50d902SRodney W. Grimeswhile 20 random 8-letter strings are produced with 190d078aa13SPhilippe Charnier.Dl "jot -r -c 160 a z | rs -g 0 8" 191d078aa13SPhilippe Charnier.Pp 1929b50d902SRodney W. GrimesInfinitely many 193d078aa13SPhilippe Charnier.Em yes Ns 's 1949b50d902SRodney W. Grimesmay be obtained through 195d078aa13SPhilippe Charnier.Dl jot -b yes 0 196d078aa13SPhilippe Charnier.Pp 1979b50d902SRodney W. Grimesand thirty 198d078aa13SPhilippe Charnier.Xr ed 1 1996a3e8b0aSRuslan Ermilovsubstitution commands applying to lines 2, 7, 12, etc.\& is 2009b50d902SRodney W. Grimesthe result of 201d078aa13SPhilippe Charnier.Dl jot -w %ds/old/new/ 30 2 - 5 202d078aa13SPhilippe Charnier.Pp 2036a3e8b0aSRuslan ErmilovThe stuttering sequence 9, 9, 8, 8, 7, etc.\& can be 2044b9cb490SKris Kennawayproduced by suitable choice of step size, 2059b50d902SRodney W. Grimesas in 2064b9cb490SKris Kennaway.Dl jot - 9 0 -.5 207d078aa13SPhilippe Charnier.Pp 2089b50d902SRodney W. Grimesand a file containing exactly 1024 bytes is created with 209d078aa13SPhilippe Charnier.Dl jot -b x 512 > block 210d078aa13SPhilippe Charnier.Pp 2119b50d902SRodney W. GrimesFinally, to set tabs four spaces apart starting 2129b50d902SRodney W. Grimesfrom column 10 and ending in column 132, use 213d078aa13SPhilippe Charnier.Dl expand -`jot -s, - 10 132 4` 214d078aa13SPhilippe Charnier.Pp 2159b50d902SRodney W. Grimesand to print all lines 80 characters or longer, 216d078aa13SPhilippe Charnier.Dl grep `jot -s \&"\&" -b \&. 80` 217a866e170SRuslan Ermilov.Sh DIAGNOSTICS 2185249bd84SSheldon HearnThe following diagnostic messages deserve special explanation: 2195249bd84SSheldon Hearn.Bl -diag 2205249bd84SSheldon Hearn.It "illegal or unsupported format '%s'" 2215249bd84SSheldon HearnThe requested conversion format specifier for 2228db8a33bSSheldon Hearn.Xr printf 3 2235249bd84SSheldon Hearnwas not of the form 2248db8a33bSSheldon Hearn.Dl %[#][ ][{+,-}][0-9]*[.[0-9]*]? 2258db8a33bSSheldon Hearnwhere 2269b88faecSRuslan Ermilov.Dq ?\& 2278db8a33bSSheldon Hearnmust be one of 2288db8a33bSSheldon Hearn.Dl [l]{d,i,o,u,x} 2298db8a33bSSheldon Hearnor 2308db8a33bSSheldon Hearn.Dl {c,e,f,g,D,E,G,O,U,X} 2315249bd84SSheldon Hearn.It "range error in conversion" 2325249bd84SSheldon HearnA value to be printed fell outside the range of the data type 2335249bd84SSheldon Hearnassociated with the requested output format. 2345249bd84SSheldon Hearn.It "too many conversions" 2355249bd84SSheldon HearnMore than one conversion format specifier has been supplied, 2365249bd84SSheldon Hearnbut only one is allowed. 2375249bd84SSheldon Hearn.El 2385249bd84SSheldon Hearn.Sh SEE ALSO 2395249bd84SSheldon Hearn.Xr ed 1 , 2405249bd84SSheldon Hearn.Xr expand 1 , 2415249bd84SSheldon Hearn.Xr rs 1 , 2425249bd84SSheldon Hearn.Xr yes 1 , 2431ab8c5beSDiomidis Spinellis.Xr arc4random 3 , 2445249bd84SSheldon Hearn.Xr printf 3 , 2455249bd84SSheldon Hearn.Xr random 3 24604f064d6SColin Percival.Sh HISTORY 24704f064d6SColin PercivalThe 24804f064d6SColin Percival.Nm 24904f064d6SColin Percivalutility first appeared in 25004f064d6SColin Percival.Bx 4.2 . 251