Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
linux_wiki:bash_scripting_snippets [2018/06/16 15:17] billdozor created |
linux_wiki:bash_scripting_snippets [2019/11/04 22:01] billdozor |
||
---|---|---|---|
Line 14: | Line 14: | ||
Different ways to generate random numbers. | Different ways to generate random numbers. | ||
+ | \\ | ||
Random 2 Digit Number< | Random 2 Digit Number< | ||
\\ | \\ | ||
Random number that is a minimum of 1 and max of 100<code bash> | Random number that is a minimum of 1 and max of 100<code bash> | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== 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 | ||
+ | </ | ||
---- | ---- | ||