Shell script to run for x hours using while Loop

Today i will discuss about the shell script code snippet which will run for x hours. Below is the code snippet which will help you to run code for x hours. ## Here I am using 10 seconds , in order to run for 1 hours, mention the same in seconds which is 3600. $vartime value will be set to 3600 initially. vartime=$((SECONDS+10)) echo $vartime ## $SECONDS tells you the time period for which script is running.Initially it will be 0 seconds when script starts. So, 0 will be compared…