Skip to main content
2 of 2
You need the "0x" prefix, and for GNU awk POSIXLY_CORRECT for hex numbers to be understood.
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k

Maybe the UUID (on Linux) can be used to retrieve the random number

$ cat /proc/sys/kernel/random/uuid
cdd52826-327d-4355-9737-895f58ad11b4

To get the random number between 70 and 100

POSIXLY_CORRECT=1 awk -F - '{print(("0x"$1) % 30 + 70)}
   ' /proc/sys/kernel/random/uuid
zangw
  • 341
  • 4
  • 5