Bash Infinite Loop Shell Linux

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/bash-infinite-shell-linux/
PINTEREST
PINTEREST
INSTAGRAM

How can write infinite shell that will run forever? May be I need a 5 second sleep between steps. Recently I have a issue with my routing table and I need to remove some route automatically every 5 minutes. I came up with a solution that runs every 4 minutes and clears unwanted routes.

While

There are a lot of different ways do express our solution one of them is when loop of bash.

Here while true runs loop forever between do and done is run regularly but sleep 5 makes the script or each step to wait 5 seconds. We can cancel script with CTRL+C.

For

We can implement our solution with for loop. 

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/bash-infinite-shell-linux/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  How To Update VMs with Libguestfs Tools

Leave a Reply

Your email address will not be published.