i want an if statement to only run if the condition in the statement is true for at least 3 consecutive seconds, how do i achieve it in linux bash shell script? i haven't done it before, and couldn't find anything specific by googling and would greatly appreciate any help! i don't mean like a loop that executes the condition x amount of times, but a function that checks of the condition is true for at least x consecutive seconds/minutes before it runs a block of code.
thanks in advance