Category:Jot: Difference between revisions

m
Change from <tt> to <code>.
(This "library" is a shell command, BSD jot(1).)
 
m (Change from <tt> to <code>.)
 
Line 1:
{{library}}
<ttcode>jot(1)</ttcode> is a shell command from [[BSD]] that can print a list of numbers. <ttcode>jot(1)</ttcode> is convenient when a [[UNIX Shell]] program needs to iterate a range of numbers. Examples that use <ttcode>jot(1)</ttcode> will not work with other Unix systems that are missing <ttcode>jot(1)</ttcode>.
 
<lang bash># Example: this loop echoes Got 1, Got 2, Got 3.
Line 7:
done</lang>
 
The syntax is <ttcode>jot count begin end step</ttcode>
 
All four arguments are optional. A hyphen <ttcode>-</ttcode> skips an argument. Here are some examples.
 
* <ttcode>jot 5</ttcode> prints 1 2 3 4 5.
* <ttcode>jot 5 10 20</ttcode> prints 10 12 15 18 20.
* <ttcode>jot -p 2 5 10 20</ttcode> prints 10.00 12.50 15.00 17.50 20.00.
* <ttcode>jot - 3 7 1</ttcode> prints 3 4 5 6 7.
* <ttcode>jot - 7 3 -1</ttcode> prints 7 6 5 4 3.
 
It has a few other features, like random numbers. For a manual page, see [http://www.openbsd.org/cgi-bin/man.cgi?query=jot&apropos=0&sektion=1&manpath=OpenBSD+Current&arch=i386&format=html jot(1)].
Anonymous user