User Tools

Site Tools


n-times_commands

Differences

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

Link to this comparison view

Next revision
Previous revision
n-times_commands [2016/03/07 14:28]
root created
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''​\\+''​for i in `seq 1 1 n`; do echo "This is the iteration $i" ; done''​\\
 \\ \\
 +
 +  * 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.1457360938.txt.gz ยท Last modified: 2016/03/07 14:28 by root