O seguinte deve fazer o que quiser:
#!/bin/bash
num=0
while ((num <= 10))
do
gnome-terminal -x sh -c "obs --startstreaming; exec bash" &
timestamp=$(date)
echo "Started OBS in new terminal window at $timestamp"
sleep 4h
pkill -n obs
timestamp=$(date)
echo "Killed OBS @ $timestamp"
((num++))
done
Aqui está a saída de shellcheck
para o seu script:
In test.sh line 1:
num=0
^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang.
In test.sh line 2:
while (($num <= 10)); do
^-- SC2004: $/${} is unnecessary on arithmetic variables.