[[linux_wiki:bash_scripting_snippets]]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
linux_wiki:bash_scripting_snippets [2019/05/26 03:50]
127.0.0.1 external edit
linux_wiki:bash_scripting_snippets [2019/11/05 03:01]
billdozor
Line 19: Line 19:
 \\ \\
 Random number that is a minimum of 1 and max of 100<code bash>​echo $[ (RANDOM % 100) + 1]</​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/05 03:02
  • by billdozor