2

Is it possible to stop a service in the shell script such as "watch"

For example, if i have the following code and I would like it to work infinitely.

#!/bin/bash

while :
do
    watch uptime
    sleep 3s
    echo "restart it"
done

The code stops at watch uptime, how can I stop it and execute the following script ?

Sam
  • 4,521
  • 13
  • 46
  • 81

0 Answers0