Empty Body For Loop Linux Shell

Viewed 11226

Hi I want to write and empty body loop. I just want the loop counter to increment so I want the cpu to stay busy without any IO operation. Here is what I have written but it gives me an error:

#!/bin/bash
for ((  i = 0 ;  i <= 1000000;  i++  ))
do
done


root@ubuntu:~# ./forLoop
./forLoop: line 4: syntax error near unexpected token `done'
./forLoop: line 4: `done'
4 Answers
Related