A long time not to come, not because of the abandonment of Linux, but to prepare for the preparation of the exam, temporary Linux. But lately there's been a little desire for yourself to write a cycle of death, and today there's something so-called inspiration that writes out the code:
#!/bin/bash
#
Uptime= ' Date +%s '
Sum=0
Add=1
While [$upTime-gt 0];d o
Let sum+= $add
Sleep 1
Echo $sum
Done
With the current total seconds time to compare with 0, because the variable is always greater than 0, the intrinsic mechanism is that the time will never go back, at least in general, machine time will not be set to 1970 ago, so while the condition after the judgment is always true, you can always execute the statement in the loop body.
And then wrote the following small program that shows the current time by the second:
#!/bin/bash
#
While [' Date +%s '-gt 0];d o
Date +%t
Sleep 1
Done
Gadgets are fun to run and work with you on a network of e-commerce websites like Xiaomi.
I wrote the first while loop of the dead loop