How to run a script every second

How to run a script every second

In this post we are going to see about how to run a script every second using linux shell script. Previously we have seen about some scripting tricks it contains more widely used scripting options and Shell Script to add users and corresponding password automatically it will give you broad explanation about adding users automatically.

Okay! Lets see how to run a script every second using linux shell script.

Here i have given the name of the file as 1sec.sh

#cat > 1sec.sh
#!/bin/bash
while [ 1 ];
do
echo “Welcome Rajkumar” >> /home/rajm/script/test
sleep 1;
done

Save the file

#chmod +x 1sec.sh
#sh 1sec.sh &

#tailf  /home/rajm/script/test
Welcome Rajkumar
Welcome Rajkumar
Welcome Rajkumar
….
….
….




Leave a Reply

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