Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:bash_scripting_snippets [2018/06/16 15:17] billdozor [Random Numbers] |
linux_wiki:bash_scripting_snippets [2019/11/04 22:02] (current) billdozor [Loop over a sequence] |
||
---|---|---|---|
Line 19: | Line 19: | ||
\\ | \\ | ||
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 | ||
+ | </ | ||
---- | ---- | ||