[[linux_wiki:bash_scripting_snippets]]

Bash Scripting Snippets

General Information

Bash scripting references and snippets.

Checklist

  • Distro agnostic

Random Numbers

Different ways to generate random numbers.


Random 2 Digit Number

echo ${RANDOM:0:2}


Random number that is a minimum of 1 and max of 100

echo $[ (RANDOM % 100) + 1]

  • linux_wiki/bash_scripting_snippets.txt
  • Last modified: 2019/05/26 03:50
  • (external edit)