Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== 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<code bash>echo ${RANDOM:0:2}</code> \\ Random number that is a minimum of 1 and max of 100<code bash>echo $[ (RANDOM % 100) + 1]</code> ---- ====== Loop over a sequence ====== To perform a loop similar to a c++ for loop: <code bash> END=10 for i in $(seq 1 ${END}); do echo ${i} done </code> ---- linux_wiki/bash_scripting_snippets.txt Last modified: 2019/11/04 22:02by billdozor