Huh… that's a pre-defined variable counting the runtime of the script. The core issue here is that you used a reserved variable. There is exactly one variable named SECONDS, so "bash incrementing any variable named SECONDS" doesn't make much sense.
Top-level
Huh… that's a pre-defined variable counting the runtime of the script. The core issue here is that you used a reserved variable. There is exactly one variable named SECONDS, so "bash incrementing any variable named SECONDS" doesn't make much sense. 3 comments
@nik Right! That’s the technically-accurate explanation. But I think many people will write a script *thinking* they’re just creating a regular old variable, not realizing they’re stepping on a landmine of good intentions |
@nik u beat me to it... @DrHyde @Cykelero