While Loop – Infinite mode

How to run while loop in infinite mode?

Below is the simple example which copies file justgeek.txt to different location as soon as it gets created. This while loop runs infinite mode and it never stops.

 #!/bin/bash
while :
do
cp -v justgeek.txt /home/justgeek
done

Leave a Reply

Your email address will not be published. Required fields are marked *