User Tools

Site Tools


n-times_commands

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
n-times_commands [2018/10/02 14:07]
root [One-liners]
n-times_commands [2018/10/11 08:02] (current)
root [One-liners]
Line 13: Line 13:
 \\ \\
  
-  * If you need to repeat n times the command+  * If you need to repeat n times the command ​(old style):
  
-''​for i in `seq 1 5`; do echo "This is the iteration $i" ; done''​\\ ​old style¬†+''​for i in `seq 1 1 n`; do echo "This is the iteration $i" ; done''​\\
-''​for i in {1..30..2}; do echo "This is the iteration $i" ; done''​\\ new style+
 \\ \\
 +
 +  * If you need to repeat n times the command (new style):
 +
 +''​for i in {1..n..1}; do echo "This is the iteration $i" ; done''​\\
 +\\
 +
  
 ===== Script version ===== ===== Script version =====
n-times_commands.1538489232.txt.gz · Last modified: 2018/10/02 14:07 by root