Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
fuss:jot [2015/01/09 05:34]
127.0.0.1 external edit
fuss:jot [2017/02/22 18:30] (current)
Line 1: Line 1:
 +====== Generating MAC Addresses ======
 +
 +<code bash>
 +printf "​%s:​%s:​%s:​%s:​%s:​%s\n"​ `jot -r -w "​%02x"​ 6 0 99`
 +</​code>​
 +
 +====== Print Sequences of Numbers ======
 +
 +Input:
 +<code bash>
 +jot - 1000 10000 1000
 +</​code>​
 +
 +Output:
 +<​code>​
 +1000
 +2000
 +3000
 +4000
 +5000
 +6000
 +7000
 +8000
 +9000
 +10000
 +
 +</​code>​
 +
 +====== Generate Unique Equal-Length Random Numbers =======
 +
 +To generate 1000 unique random numbers, issue:
 +<code bash>
 +jot -r 1000 0 65535 | uniq | xargs printf "​%05d\n"​
 +</​code>​
 +
 +where the ''​jot''​ parameters mean:
 +  * ''​-r''​ means generate random numbers,
 +  * ''​1000''​ for 1000 random numbers,
 +  * ''​0''​ the starting numbers,
 +  * ''​65535''​ the ending random number
 +
 +The ''​uniq''​ command eliminates any duplicate random numbers. After that the ''​barges''​ command is used to pass the numbers to ''​printf''​ as parameter. The ''​printf''​ command then takes ''​%05d\n''​ as the formatting parameter meaning to print a 5-digit number all the time (for example, if ''​jot''​ generates the number ''​1'',​ then ''​printf''​ makes sure to pre-pend zeros to obtain ''​0001''​.
  

fuss/jot.txt ยท Last modified: 2017/02/22 18:30 (external edit)

Access website using Tor Access website using i2p


For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy and plagiarism pages.