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
n-times_commands [2018/10/02 14:08]
root [One-liners]
n-times_commands [2018/10/11 08:02] (current)
root [One-liners]
Line 15: Line 15:
   * If you need to repeat n times the command (old style):   * 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):   * If you need to repeat n times the command (new style):
  
-''​for i in {1..30..2}; do echo "This is the iteration $i" ; done''​\\+''​for i in {1..n..1}; do echo "This is the iteration $i" ; done''​\\
 \\ \\
  
n-times_commands.txt ยท Last modified: 2018/10/11 08:02 by root